Our new Trac install is working very well. Since it’s simpler than Gforge was, people seem much more interested in using it (even, if they’ll forgive my saying so, some members of the graphic design team).

We’ve run into a few minor problems, though. In situations where particularly long SVN commits have taken place, or where the “Browse Source” listing for a project is really long, we kept getting 500 Server Error messages. The apache2 log said Premature end of script headers. Thinking back to my previous experiences with Rails, I thought it might be the idle timeout with FastCGI, so I added these directives to /etc/apache2/mods-enabled/fcgid.load.

IPCCommTimeout 40
IPCConnectTimeout 10

This allows Trac to think about a page for up to 40 seconds before rendering it - one page we had problems with, showing a very long SVN commit, was 1.1 MB (!) of HTML, coloured and diffed. That page takes about 7 seconds to render, the default timeout must have been (I’m guessing) 5 seconds or something.

Now to figure out why Apache is not delivering rss feeds from Trac with the proper mime types, and we’re in pretty good shape.


One Response to “Avoiding FastCGI Trac Timeouts”  

  1. 1 Gunnar Wagenknecht

    Thanks for this tip. I had similar problems with WordPress and mod_fcgid. I turned on some verbose logging and found a 5 seconds data timout. I checked the mod_fcgid documentation top-down and left-right but never found an option for this. Hopefully it’s better now.

Leave a Reply