If you see any lines like the one below, then you’ll want to adjust some of these settings:
server reached max_children setting (5), consider raising
Adjusting The max_children Setting
To adjust the settings, you’ll need to find your php-fpm.conf or www.conf depending on what version of PHP-FPM you have installed. In my case, I had to edit /etc/php/7.0/fpm/pool.d/www.conf. You’ll want to look for the following settings and make adjustments based on your server specs:
A few of these settings are the default, like pm=dymanic. For the pm.max_requests, the setting should be there but commented out with a ; in front of the line. Delete the ; to uncomment the setting.
To get an idea of what to use for the pm.max_children, you can use this calculation: pm.max_children = Total RAM dedicated to the web server / Max child process size. Remember to leave some RAM for extra services you have running on your system.
Also remember, higher isn’t always better. If you have a bad PHP script, these settings won’t resolve your issues. Tweak these settings and see what works best on your server. After you make the changes, you need to restart your PHP-FPM service. Depending on the name of your service, you can try on of the following: