PHP5-FPM crashing: "server reached pm.max_children setting" (Ubuntu 14 - LEMP)

February 2, 2015 18.6k views

My WordPress droplet, 512gb/Ubuntu14/Swap/LEMP/never gave a problem. From today PHP5-FPM writes this message in /var/log/upstart/php5-fpm.log:

WARNING: [pool www] server reached pm.max_children setting (5), consider raising it

So after reading, I've been increasing this size to 30 in /etc/php5/fpm/pool.d/www.conf but still writes the error, now:

server reached pm.max_children setting (30)

What's the reason this is happening now? It hasn't been a high traffic lately, and $free shows 200mb free memory.

2 comments
  • We will need to see your pool config to get more insight. None of this information points to a clear problem without the full details of the pool (what mode, how many starting children, etc)

  • Sure, details of /etc/php5/fpm/pool.d/www.conf:

    pm = dynamic
    pm.max_children = 30 (original: 5)
    pm.start_servers = 3 (original: 1)
    pm.min_spare_servers = 2 (original: 1)
    pm.max_spare_servers = 4 (original: 3)
    pm.max_requests = 500 (originally commented)
    
6 Answers

Any news here? One of my servers is having the exact same problem and I can't figure out why.

having same problem, did anyone figure it out?

Having the same problem. I also increase the pm.max_children but it doesn't fixed the problem.

Someone could do a good job for the humanity and answer this! :)

Is this even a problem? What is this warning?

Hi, So you did not describe what kind of server Nginx was hosting. If it is a wordPress that is exposed to the world, then my guess the script-kiddies are slamming you with login requests and/or searching for other WP potential exploits.

You should go back to your Nginx logs and see where all the traffic is going to. You can then address them with Nginx rate-limits. (See : https://www.nginx.com/blog/rate-limiting-nginx/) There you can put realistic limits and not allow them to hit your server unfettered.

Have another answer? Share your knowledge.