I've got this PHP site that makes some hefty ajax calls. They take about 8-10 seconds and communicate with a lot of 3rd party APIs via cURL requests.
When these ajax calls are going on, the rest of the site is unresponsive. Not just this page, but another browser tab on another page all together.
what should I check to make sure PHP is able to fork multiple processes so the site doesn't hang?
PHP is run as PHP-fpm
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
fastcgi_buffers 256 64k;
fastcgi_buffer_size 2400k;
fastcgi_read_timeout 6000;
uwsgi_read_timeout 6000;
include fastcgi_params;
}
And nginx has enough worker procs
user www-data;
worker_processes 16;
pid /var/run/nginx.pid;
events {
worker_connections 8000;
multi_accept on;
}
Also, I've tested with sleep() and a long for loop. Both of those are fine. It seems just the cURL calls to external sites that cause the issue.
Not sure what's missing.
Thanks!