Intensive PHP script failing w/ “The timeout specified has expired” error / ap_content_length_filter

后端 未结 10 1182
南方客
南方客 2020-12-30 10:50

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         


        
10条回答
  •  不思量自难忘°
    2020-12-30 11:31

    for anyone that may come across this. I was able to solve this by looking into memcache.

    my situation:

    1. a memcached server that is being used by multiple apache servers
    2. memcached.sess_locking = On
    3. make back to back requests on the same session (within ms of each other)

    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.

提交回复
热议问题