Running a MySQL intensive PHP script that is failing. Apache log reports this:
[Wed Jan 13 00:20:10 2010] [error] [client xxx.xx.xxx.xxxx] (70007)
The timeou
for anyone that may come across this. I was able to solve this by looking into memcache.
my situation:
outcome: the second requests gets stucks and times out
solution 1: set memcached.sess_locking = Off in your php.ini
Solution 2: decrease memcached.sess_lock_wait_min
why it works: when a second request comes in while first one has locked the session file, the second session has to wait. If memcached.sess_lock_wait_min is set too high it just waits that long before trying to get the possession of the lock. it is super easy to test this using sess_locking = Off. If it does help you then you definitely want to play around with lock time values to see what works better for you.
There is a timeout in the php.ini
as well.
I hit a very similar wall as well with Apache 2.4.6 and PHP 5.4.23 FPM/FastCGI.
No matter what I set in PHP or Apache, my script would timeout in 30 seconds and I would see the following in my Apache Error log:
[timestamp] [proxy_fcgi:error] [pid...] (70007)The timeout specified has expired: [client ...] AH01075: Error dispatching request to :
TimeOut 300
KeepAliveTimeout 300
<IfModule reqtimeout_module>
RequestReadTimeout header=120-240,minrate=500
RequestReadTimeout body=120,minrate=500
</IfModule>
<IfModule mod_proxy.c>
ProxyTimeout 300
</IfModule>
<IfModule mod_fcgid.c>
FcgidConnectTimeout 300
</IfModule>
ini_set( 'max_execution_time', '120' );
...
ini_restore( 'max_execution_time' );
mod_proxy_fcgi
Take a look at the bug report here
There is another timeout value placed not in php itself but in apache server. It will brake script when nothing is on output for specified time so when doing harder work in PHP you can reach this limit. Just echo anything back to browser (not buffers!) or increase apache timeout value to safe value, as far as I remember it's KeepAliveTimeOut apache property. Good luck :)