Apache proxfy_fcgi - Error dispatching request to

require_once picture require_once · Oct 27, 2015 · Viewed 50.1k times · Source

I have cloud hosting on Google, it sucks for to be honest but I am trying to get on with it, I installed LAMP stack on a VM and put my website in htdocs. When I try to access my site it gives me request timeout but sometimes it works for 5 minute or so.

When I see apache error logs , it gives me this

075: Error dispatching request to : (polling)
[Tue Oct 27 18:12:55.185819 2015] [proxy_fcgi:error] [pid 4995:tid 140183521683200] (70007)The timeout specified has expired: [client 162.158.255.169:34198] AH01075: Error dispatching request to : (polling)
[Tue Oct 27 18:12:55.487458 2015] [core:notice] [pid 2953:tid 140183785137920] AH00052: child pid 4995 exit signal Segmentation fault (11)
[Tue Oct 27 18:12:55.787973 2015] [proxy_fcgi:error] [pid 5063:tid 140183530075904] (70007)The timeout specified has expired: [client 199.27.133.137:13151] AH01075: Error dispatching request to : (polling), referer: http://whichtube.com/watch/g9-4dCeFQng/allama-nasir-abbas-jawab-ali-as-nae-talwar-kayou-na-uthai.html
[Tue Oct 27 18:12:57.542883 2015] [proxy_fcgi:error] [pid 5329:tid 140183521683200] (70007)The timeout specified has expired: [client 173.245.56.198:51348] AH01075: Error dispatching request to : (polling)
[Tue Oct 27 18:12:57.976752 2015] [proxy_fcgi:error] [pid 5063:tid 140183479719680] (70007)The timeout specified has expired: [client 173.245.56.198:63779] AH01075: Error dispatching request to : (polling)
[Tue Oct 27 18:12:58.993666 2015] [proxy_fcgi:error] [pid 5194:tid 140183496505088] (70007)The timeout specified has expired: [client 162.158.255.141:16226] AH01075: Error dispatching request to : (polling)
[Tue Oct 27 18:12:59.196701 2015] [proxy_fcgi:error] [pid 5329:tid 140183513290496] (70007)The timeout specified has expired: [client 173.245.56.198:32819] AH01075: Error dispatching request to : (polling)
[Tue Oct 27 18:13:01.462039 2015] [proxy_fcgi:error] [pid 5329:tid 140183504897792] (70007)The timeout specified has expired: [client 199.27.128.166:48057] AH01075: Error dispatching request to : (polling)
[Tue Oct 27 18:13:07.518999 2015] [proxy_fcgi:error] [pid 5063:tid 140183471326976] (70007)The timeout specified has expired: [client 173.245.56.198:13694] AH01075: Error dispatching request to : (polling)
[Tue Oct 27 18:13:16.804990 2015] [proxy_fcgi:error] [pid 5261:tid 140183513290496] (70007)The timeout specified has expired: [client 199.27.128.134:28694] AH01075: Error dispatching request to : (polling)
[Tue Oct 27 18:13:33.055860 2015] [proxy_fcgi:error] [pid 5328:tid 140183236331264] (70007)The timeout specified has expired: [client 39.41.139.220:52154] AH01075: Error dispatching request to : (polling)
[Tue Oct 27 18:13:57.391361 2015] [proxy_fcgi:error] [pid 5063:tid 140183521683200] (70007)The timeout specified has expired: [client 39.41.139.220:52029] AH01075: Error dispatching request to : (polling)
[Tue Oct 27 18:13:57.552542 2015] [core:notice] [pid 2953:tid 140183785137920] AH00052: child pid 5063 exit signal Segmentation fault (11)

My website is in PHP, I haven't changed anything else other than directory permission, Is there something I am missing ?

Answer

Roberto Ibarra Rabadán picture Roberto Ibarra Rabadán · May 15, 2019

I was having the same problem, turns out Apache has module that handles timeouts called mod_reqtimeout

The default value (you won't see it in the default http.conf) is:

RequestReadTimeout handshake=0 header=20-40,MinRate=500 body=20,MinRate=500

In my case I was uploading a file through a plain HTML form submission, so the file is technically part of the header and the default configuration says that the header will timeout at 20 to 40 seconds. The 20-40 thing is pretty cool because it will timeout at 20 seconds but if 500 bytes are sent in a second, it will add an additional second of wait time until it reaches 40 seconds and then timeout no matter what.

I upload larger files in my website so I added this line to my httpd.conf file:

RequestReadTimeout handshake=0 header=20-600,MinRate=500 body=20,MinRate=500

So as long as my user is sending data at a minimum of 500 bytes/s, the request will not time out until a max. of 600 seconds is reached (better read the documentation, don't quote me on the throughput rate)

It's actually a pretty cool Apache module but not super well known as people recommend to change other apache timeout settings in other similar "The timeout specified has expired:" problems related to PHP-FPM but this problem happens with any post that takes more than 40 seconds to be submitted by default in Apache.