Re: odd 30 second timeout when using mod_proxy_fcgi and php-fpm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This seems like the place. I have came across the same issue (mod_rewrite proxy rules not respecting ProxyTimeout), and changing 30 to something more reasonable fixed the issue.


2013/4/26 Daniel Steen <dsteen@xxxxxxxxxxxxxxxxxxx>
Hi All!

We are having an issue where, if a php script is waiting for more than 30 seconds, apache will kill the connection to php-fpm with the following error:

[Thu Apr 25 15:20:11.977250 2013] [proxy_fcgi:error] [pid 21763:tid 140634392327936] (70007)The timeout specified has expired: [client 172.16.131.26:47588] AH01075: Error dispatching request to :

(That's the exact error, not cut or redacted in any way.)

The easiest way to reproduce this is to create a php script that contains only "sleep(60);".  After 30 seconds apache will stop waiting and return an error.

We are using apache 2.4.2 and php 5.3.6, and have things set up so that apache proxies over to php-fpm using mod_proxy_fcgi.

Unfortunately, the error message above doesn't provide very much information.  I have turned on debugging in php-fpm, but it only shows that the connection was terminated - no error message.   I have increased debugging in apache (LogLevel debug trace4), but it still only shows the message above.

The relevant section of my config looks like this:

 ProxyTimeout 600
 Timeout 600
 RewriteCond %{REQUEST_FILENAME} \.php
 RewriteRule (.*) fcgi://localhost:9000/opt/mm/planner/current$1 [L,P,QSA]

My php configs are:

php.ini:
max_execution_time = 5
max_input_time = 3
memory_limit = 8192M

php-fpm.conf:
request_terminate_timeout = 0
request_slowlog_timeout = 0


At one point I set the request_terminate_timeout to both higher and lower than 30 seconds.   When it was lower than 30 seconds, the script would be killed by php.  When it was higher than 30 seconds, we would see the apache error above, and then once the request_terminate_timeout was hit php would print a message indicating it had killed the script.

I've even gone so far as to trawl through the apache source code.   I did find this in mod_proxy_fcgi.c:

   /* We need SOME kind of timeout here, or virtually anything will
    * cause timeout errors. */
   if (! conn->worker->s->timeout_set) {
       timeout = apr_time_from_sec(30);
   }

Which seems to be a hard-coded 30 second timeout if no other timeout is set.   Is there a way to set the "Connection Worker"  (I guess?) timeout?  Or is this totally the wrong thing to be looking at?

Any help with this issue would be greatly appreciated.


Thanks!
Daniel Steen








---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux