Hou, senseless timeout setting of fcgid
Don’t want to know how many people were hunting the reason for their FastCGI/FCGI installation throwing “premature end” 500 errors on them sometimes. If a CGI script (e.g. the PHP process) doesn’t answer for 5 seconds (yes, 5 seconds. Do not even think about doing a more complicated calculations inside your PHP scripts!), the user gets this nice HTTP error 500. As soon as you find out that not you are guilty (your script works just fine, only takes a bit longer), it’s even not that hard to find other people reporting the very same problem: Nikolas, Brian, Typo3 list, RubyOnRails wiki, RubyOnRails weblog, …
Once again, taken from RubyOnRails wiki, maybe it will help somebody (the docs can be found here):
<IfModule mod_fcgid.c> ... IPCConnectTimeout 8 IPCCommTimeout 48 ... </IfModule>
Increasing the IPC timeout leaves enough time for your PHP script to finish. This solves the main problem in my Pingback implementation for PmWiki. It seems that the HTTP requests in the XMLRPC classes used there were blocking the PHP process, so it didn’t answer any IPC calls from mod_fcgid anymore.
7 Comments »
RSS feed for comments on this post. TrackBack Website





[...] Hou, senseless timeout setting of fcgid [...]
Helo,
i have this problem in the logs:
Seems like the “IPCConnectTimeout 40″ is to small. So i increased it in /etc/apache2/mods-enabled/fcgid.conf but i get the error again if i run the script. Maybe you can help me?
Do a -full- apache stop and start, sometimes apache and mod_fcgid can be funny
. It happened to me today!
Thank you so much for this! I was having serious errors with 500’s all the time. Now my site runs smoothly!