You are here: Foswiki>Tasks Web>Item12318 (28 Dec 2013, GeorgeClark)Edit Attach

Item12318: ApacheConfigGenerator needs TimeOut directive

Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Web Site
Component: ApacheConfigGenerator
Reported By: TimotheLitt
Waiting For:
Last Change By: GeorgeClark
The new Configure has some operations that can take a very long time. (Notably, mail autoconfigure in the worst case can take on the order of 10 minutes - or even more -if it encounters sites with multiple IP addresses, nasty firewalls, and unusual port/service combinations. Even in a simple case, Net::SMTP's IO timeout is 2 minutes.)

This exceeds the default httpd TimeOut (60 sec) in my distribution, and proably others. (After TimeOut seconds with no response, httpd kills the CGI and returns a 5xx error - which one depends on the version of httpd.)

To avoid these 504 'Upstream gateway timeout' and 500 'Internal Error' mystery messages and to allow autoconfigure to handle these situations, the apache TimeOut directive should be included in configurations.

TimeOut 900 should be adequate, though it wouldn't hurt to see if any other components have wishes. (I've had SEARCHes and topic RENAMES take longer than 60 sec...) FYI, Apache originally defaulted this to 1200.

The potential downside is that truly unresponsive CGI's will take longer to be cleaned-up, and could be used as an inefficient DOS attack. But it that works, there are bigger issues...

On balance, we should add the directive - if for no other reason than to have it in the file with some value. That gives a clue that timeout is an issue, and it's easier to tell people to change a value than to tell them exactly where to add one...

-- TimotheLitt - 28 Dec 2012

This probably is a bit more complex. I'm adding a simple TimeOut setting at the base server level, which will show up in 3 places:
  • TimeOut xxx (Apache 2.4 default 60 seconds, 2.2 -> 1.2 300 seconds. Prior to Apache 1.2 it was 1200 seconds.)
  • FcgidIOTimeout xxx (Default is 40 seconds)
    • Results in the following error messages:
      mod_fcgid: read data timeout in xxx seconds
      Premature end of script headers: foswiki.fcgi
  • FcgidBusyTimeout xxx (Default is 300 seconds)

While I'm in the code, there is another default that cause issues with Fcgid users is the FcgidMaxRequestLen. Default is 131072 bytes. (Before mod_fcgid versions 2.3.6, this defaulted to 1GB.) This will limit the max attachment size to somewhat less than 130K due to encoding overhead.

-- GeorgeClark - 29 Dec 2012

This was done ages ago. Closing.

-- GeorgeClark - 28 Dec 2013
Topic revision: r3 - 28 Dec 2013, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy