我是否应该将 pm.start_servers 设置为最高值?

我是否应该将 pm.start_servers 设置为最高值?

我的 PHP-FPM 上有以下设置:

pm.max_children = 256
pm.start_servers = 50
pm.min_spare_servers = 40
pm.max_spare_servers = 128

即使我将其设置为更高的值,仍然会出现以下错误:

[13-Dec-2013 11:58:55] WARNING: [pool web2] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 36 idle, and 58 total children
[13-Dec-2013 11:58:56] WARNING: [pool web2] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 32 idle, and 62 total children
[13-Dec-2013 11:59:12] WARNING: [pool web2] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 26 idle, and 77 total children
[13-Dec-2013 11:59:13] WARNING: [pool web2] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 27 idle, and 85 total children

我创建了一个脚本,当pm.max_spare_servers达到 90 时,它将重新加载 php5-fpm。但是,有时,在重新加载 php5-fpm 服务之前,它已经达到了最大备用服务器,因为我仅每 15 分钟运行一次 cron 来检查该值。

start_servers所以我的问题是,如果我将其设置为最低值而不是更高值,会有什么区别。

说类似这样的话:

pm.max_children = 256
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 128

顺便说一句,我正在使用 nginx 和 ubuntu 12.04。

相关内容