server reached pm.max_children setting (5), consider raising it

MTAI Team 0 Reputation points
2025-02-01T17:11:31.16+00:00

The website is down with the following error in the server logs.

server reached pm.max_children setting (5), consider raising it

I tried to set its value to 32 in /usr/local/etc/php-fpm.d/www.conf but when I try to access website it says 504 and after refreshing the web ssh pm.max_children auto set to 5. I also kill pm process using and start it again

ps aux | grep php-fpm

kill -9 <php-fpm_pid>

/usr/local/sbin/php-fpm

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,035 questions
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 11,055 Reputation points Volunteer Moderator
    2025-02-01T20:33:35.03+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    This error indicates that your PHP-FPM configuration is limiting the number of concurrent PHP processes to 5, which is insufficient for your website's traffic. To resolve this issue:

    Edit the PHP-FPM configuration file (/usr/local/etc/php-fpm.d/www.conf) and set a higher value for pm.max_children

    pm.max_children = 32
    
    

    After modifying the configuration, restart PHP-FPM to apply the changes

    sudo service php-fpm restart
    
    

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.