为什么php-fpm警告重生儿童?

时间:2012-04-11 17:58:46

标签: php

当我的服务器收到许多请求时,php-fpm记录(php5-fpm.log)如下:

WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 6 total children

我的php-fpm.conf是:

    ...
    pm = dynamic
    pm.max_children = 50
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 3
    pm.max_requests = 200
    ...

1 个答案:

答案 0 :(得分:1)

您似乎需要更改php-fpm.conf。

pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

正如php-fpm.log所示,[pool www]似乎很忙。总共有6个孩子,php-fpm会产生8个以上。这意味着没有足够的php-fpm进程。我建议你根据你的服务器性能增加pm.start_servers,pm.min_spare_servers和pm.min_spare_servers。