一旦池到达pm.max_children,Nginx就会在尝试向PHP-FPM发送新请求时开始超时. PHP-status页面中的“max listen queue”始终为0.
以下是PHP-fpm池的示例:
[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