Roots Discourse

Pm.max_children

Hey there folks. Out of the blue, I’m getting this error on my server, which causes it get a 502. I’m sure it’s a plugin or something issue, but I was wondering what the recommendation for increasing this is: [pool wordpress] server reached pm.max_children setting (10), consider raising it.

That error means that PHP-FPM has run out of processes to handle requests.

You can adjust this value in /trellis/roles/php/

You need to adjust max_children in sync with the following other properties, depending on the RAM and CPU of your server :

pm.start_servers
pm.min_spare_servers
pm.max_spare_servers
pm.max_requests

Can you give us some more information about the server? The /trellis/roles/php/templates/php-fpm.conf.j2 is ideal for a small server, if you have a larger server with lots of requests, you will need to set up larger values for the above settings. Use a resource such as this one to get you started.

4 Likes

Hey there, sorry for the slow response. I had figured it out after I wrote this down. I started logging my slow responses with request_slowlog_timeout = 10 slowlog = /var/log/slow.$pool.log and enabled the php-fpm status page and realized that one of my plugins was querying a server that was timing out, causing the number of processes to be more than the max_children.

Keeping the number at the default 10 is working just fine for me.

Hi Brandon. Where did you put in the slowlog settings? I keep trying to add them into trellis/roles/wordpress-setup/templates/php-fpm.conf.j2 or into trellis/roles/wordpress-setup/defaults/main.yml and when reprovisioning php-fpm fails to start.