Knowledgebase:
The timeout specified has expired - PHP-FPM
Posted by Ryan Mendonca on 24 October 2019 12:23:21 PM

You might have come across issues reported by our customers with their web application on VPS/Dedicated server using PHP-FPM as the handler where the application resolves to 500 Internal Server errors or a Connection timeout error when using along with Cloudflare CDN service.

In order to troubleshoot these issues, you need to first verify the Apache logs. On checking the logs, you might encounter the following error in the Apache error logs:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Fri Oct 04 12:08:26.485095 2019] [proxy_fcgi:error] [pid 23450] (70007)The timeout specified has expired: [client 172.69.69.16:42114] AH01075: Error dispatching request to : (polling), referer: https://www.helioscart.com
[Fri Oct 04 12:08:26.533915 2019] [proxy_fcgi:error] [pid 23212] (70007)The timeout specified has expired: [client 172.69.70.143:60776] AH01075: Error dispatching request to : (polling), referer: https://www.helioscart.com
[Fri Oct 04 12:08:27.180952 2019] [proxy_fcgi:error] [pid 21673] (70007)The timeout specified has expired: [client 162.158.154.139:32214] AH01075: Error dispatching request to : (polling), referer: https://www.helioscart.com/
[Fri Oct 04 12:08:32.023087 2019] [proxy_fcgi:error] [pid 23775] (70007)The timeout specified has expired: [client 162.158.155.44:26148] AH01075: Error dispatching request to : (polling), referer: https://www.helioscart.com/
[Fri Oct 04 12:08:43.295016 2019] [proxy_fcgi:error] [pid 23919] (70007)The timeout specified has expired: [client 162.158.166.113:18888] AH01075: Error dispatching request to : (polling), referer: https://www.helioscart.com/ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
In order to ascertain the root cause of the issue, you need to verify the PHP-FPM error logs for the domain from the path mentioned below:
 
Location: /opt/cpanel/ea-php56/root/usr/var/log/php-fpm/error.log 
 
In the above path, you need to replace "ea-php56" with the PHP version enabled for the domain on the server.
 
In the logs, you will locate the following error logs:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[04-Oct-2019 09:41:31] WARNING: [pool helioscart_com] server reached max_children setting (5), consider raising it
[04-Oct-2019 11:38:27] WARNING: [pool helioscart_com] server reached max_children setting (5), consider raising it
[04-Oct-2019 11:40:40] WARNING: [pool helioscart_com] server reached max_children setting (5), consider raising it
[04-Oct-2019 13:08:04] WARNING: [pool helioscart_com] server reached max_children setting (5), consider raising it
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
** Please note that you may verify the PHP version and PHP-FPM handler from the ROOT WHM Panel > MultiPHP Manager.
 
The above logs clearly indicate that the PHP-FPM pool of the respective domain is hitting the max_children processes.

In order to fix the issue, you need to increase the max_children value.  You can increase the value from WHM Panel > MultiPHP Manager > System PHP-FPM Configuration.
 
The max_children setting is not the number of simultaneous visitors your site can have. Instead, it is the number of simultaneously executing PHP requests.
 
However, please note that the main risk of increasing max_children is that each additional PHP process uses additional memory, so your server needs more memory as you increase max_children. The amount of memory used by each executing PHP process depends heavily on the app's PHP code. For WordPress apps, this includes the code of the plugins and themes.

Alternately, you can also advise the client to disable the PHP-FPM handler on the domain and use a different PHP handler.

(0 vote(s))
Helpful
Not helpful

Comments (0)