If you're encountering errors on your website, it's crucial to investigate the error logs to identify the root cause. PHP-FPM errors can stem from various factors, but a common culprit is the PHP-FPM limits being reached due to inadequate settings.
By checking the error log, you can gain valuable insights into the specific errors and warnings being generated, helping you pinpoint the exact issue. In many cases, the PHP-FPM settings are simply set too low, leading to errors when the limits are exceeded. Adjusting these settings, such as increasing the max_children or max_requests values, can often alleviate the errors and improve the performance and stability of your PHP applications. Regularly monitoring the error log and fine-tuning your PHP-FPM settings will help ensure a smooth and error-free experience for your website visitors.
In this article, we will explain how to check if PHP-FPM limits are being hit on a VPS or Dedicated server with cPanel installed.
Related Articles
Adjust PHP-FPM Limits
Toggle PHP-FPM for Domain in WHM
Check for Errors
IMPORTANT: This solution will require root access. If this needs to be obtained, follow the guide on requesting root access.
- Access your server via SSH as the root user or using the Terminal in Root WHM
- Run the following command to filter the PHP-FPM logs for all versions of PHP installed on the server
If your server runs cPanel:
cat /opt/cpanel/ea-php*/root/usr/var/log/php-fpm/error.log | grep -i max
If your server runs CWP:
cat /opt/alt/php-fpm*/usr/var/log/php-fpm.log | grep -i max
- If the max_children limit is being hit, consider raising it
EXAMPLE: Results should look similar to the below if your server is hitting the max_children limit of PHP-FPM. If it is not hitting limits, the command will return no output.
root@server [~]# cat /opt/cpanel/ea-php*/root/usr/var/log/php-fpm/error.log | grep -i max [16-Oct-2022 05:10:49] WARNING: [pool domain_com] server reached max_children setting (5), consider raising it [16-Oct-2022 05:10:50] WARNING: [pool domain_com] server reached max_children setting (5), consider raising it [16-Oct-2022 05:10:53] WARNING: [pool domain_org] server reached max_children setting (5), consider raising it [16-Oct-2022 05:10:53] WARNING: [pool domain_net] server reached max_children setting (5), consider raising it [16-Oct-2022 05:11:02] WARNING: [pool domain_com] server reached max_children setting (5), consider raising it
Comments
0 comments
Article is closed for comments.