As soon as a pool reached pm.max_children, Nginx starts timing out when trying to send new requests to PHP-FPM. "max listen queue" is always 0 in the php-status page.
- PHP-FPM 5.5.16
- Nginx 1.6.1
Here is the example for a php-fpm pool:
[example] catch_workers_output = no ; Configure listener listen = /var/run/php-fpm/example.sock listen.backlog = 65535 listen.owner = nginx listen.group = nginx ; Unix user/group of processes user = nginx group = nginx ; Choose how the process manager will control the number of child processes. pm = ondemand pm.max_children = 10 pm.max_requests = 200 pm.process_idle_timeout = 30s pm.status_path = /status ; Pass environment variables env[HOSTNAME] = $HOSTNAME env[PATH] = /usr/local/bin:/usr/bin:/bin env[TMP] = /tmp env[TMPDIR] = /tmp env[TEMP] = /tmp ; Host specific php ini settings here php_admin_flag[log_errors] = on php_admin_value[open_basedir] = /tmp:/var/www/apc:/var/www/wordpress/example php_admin_value[error_log] = /var/log/php-fpm/example.log