【发布时间】:2014-02-07 22:13:36
【问题描述】:
我收到此错误:
警告:[pool www] 服务器达到 pm.max_children 设置 (5),考虑提高它
在我的 PHP 错误日志中尝试访问我在 forums.domain.com 上的 XenForo 安装时。
它每次都会发生,我认为它会导致 PHP 崩溃,从而阻止同一框上的其他站点也能正常工作。
我正在为这两个站点使用带有两个服务器块的 nginx。一个是新的。还有一个在论坛下..
谢谢。
【问题讨论】:
我收到此错误:
警告:[pool www] 服务器达到 pm.max_children 设置 (5),考虑提高它
在我的 PHP 错误日志中尝试访问我在 forums.domain.com 上的 XenForo 安装时。
它每次都会发生,我认为它会导致 PHP 崩溃,从而阻止同一框上的其他站点也能正常工作。
我正在为这两个站点使用带有两个服务器块的 nginx。一个是新的。还有一个在论坛下..
谢谢。
【问题讨论】:
在 Ubuntu 12(可能还有其他地方)上,pm.max_children 值在配置文件 /etc/php5/fpm/pool.d/www.conf 中设置。在文件中搜索该字符串并增加该值。使用此命令重新启动 PHP 以使更改生效:
sudo service php5-fpm restart
如果您使用的是 Apache,您可能需要先重新启动该服务。
【讨论】:
grep -s 'max_children' /etc/php/7.4/fpm/pool.d/{*,.*}/etc/php/7.4/fpm/pool.d/www.conf:; static - a fixed number (pm.max_children) of child processes;
配置您的池 pm.* 指令并重新加载/重新启动 PHP - http://www.php.net/manual/en/install.fpm.configuration.php
pm.max_children int
The number of child processes to be created when pm is set to static and the maximum number of child processes to be created when pm is set to dynamic. This option is mandatory.
This option sets the limit on the number of simultaneous requests that will be served. Equivalent to the ApacheMaxClients directive with mpm_prefork and to the PHP_FCGI_CHILDREN environment variable in the original PHP FastCGI.
【讨论】: