The warning message you are seeing in the Nginx error logs is related to PHP-FPM's process manager (pm) settings. It indicates that the current number of active PHP-FPM processes (children) is reaching the maximum limit, and there are no idle processes available to handle incoming requests.
To resolve this issue, you can adjust the pm settings in your PHP-FPM configuration file. Here's how you can do it:
- SSH into your server.
- Locate the PHP-FPM configuration file. It is usually located at
/etc/php/{PHP_VERSION}/fpm/pool.d/www.conf. Replace{PHP_VERSION}with the actual version of PHP you are using. - Open the
www.conffile using a text editor. - Look for the following lines:
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
- Adjust the values based on your server's requirements. For example, you can increase
pm.max_childrento allow more PHP-FPM processes to handle requests. - Save the changes and exit the text editor.
- Restart PHP-FPM to apply the new configuration. You can do this by running the following command:
sudo service php{PHP_VERSION}-fpm restart
Replace {PHP_VERSION} with the actual version of PHP you are using.
By increasing the values of pm.start_servers, pm.min_spare_servers, and pm.max_spare_servers, you can ensure that there are enough idle PHP-FPM processes available to handle incoming requests, reducing the occurrence of the warning message.
Remember to monitor your server's resource usage after making these changes to ensure that it can handle the increased number of PHP-FPM processes without any issues.