[Trac-tickets] [The Trac Project] #2252: FastCGI gets a timeout but
renders correct pages afterwards
The Trac Project
noreply at edgewall.com
Thu Oct 20 15:01:47 CDT 2005
#2252: FastCGI gets a timeout but renders correct pages afterwards
--------------------------------------------+-------------------------------
Reporter: thomas.jachmann at mindmatters.de | Owner: jonas
Type: defect | Status: new
Priority: normal | Milestone:
Component: general | Version: 0.8.4
Severity: normal | Keywords: |
--------------------------------------------+-------------------------------
From time to time (every 5 to 10 requests), trac hangs. This is the output
of apache's error log:
{{{
[Thu Oct 20 21:33:01 2005] [error] [client ...] FastCGI: comm with server
"/usr/share/trac/cgi-bin/trac.fcgi" aborted: idle timeout (30 sec),
referer: [...]
[Thu Oct 20 21:33:01 2005] [error] [client ...] FastCGI: server
"/usr/share/trac/cgi-bin/trac.fcgi" stderr: Traceback (most recent call
last):, referer: [...]
[Thu Oct 20 21:33:01 2005] [error] [client ...] FastCGI: server
"/usr/share/trac/cgi-bin/trac.fcgi" stderr: File "/usr/lib/python2.3
/site-packages/trac/web/_fcgi.py", line 567, in run, referer: [...]
[Thu Oct 20 21:33:01 2005] [error] [client ...] FastCGI: server
"/usr/share/trac/cgi-bin/trac.fcgi" stderr: protocolStatus, appStatus
= self.server.handler(self), referer: [...]
[Thu Oct 20 21:33:01 2005] [error] [client ...] FastCGI: server
"/usr/share/trac/cgi-bin/trac.fcgi" stderr: TypeError: unpack non-
sequence, referer: [...]
}}}
The first line only appears when the request hangs, the remaining four
lines are written to the error log for each - even not-hanging - request.
This seems to be an error with trac.fcgi. Parts of the page are rendered,
then it hangs for 30 seconds (the FastCGI timeout). Then, the rest of the
page is passed to the browser and gets rendered. Nothing is broken. From
the browser's view, it just looks like the server takes a break in the
middle of the page. I just don't understand the timeout - this seems as if
trac.fcgi execution gets cancelled by FastCGI, but still all content gets
back to the browser in the end.
The following is my current apache configuration for the virtual host
running trac. I run several projects off the root of the virtual host,
avoiding the trac.fcgi script in the URL by using the !ScriptAliasMatch
directive. This is all taken from trac's documentation.
{{{
FastCgiConfig -initial-env TRAC_ENV_PARENT_DIR=/var/trac/ -idle-timeout 1
<VirtualHost *:80>
ServerName [...]
DocumentRoot /usr/share/trac/htdocs
<Directory "/usr/share/trac/htdocs">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
AliasMatch ^/[^/]+/chrome/common(.*) /usr/share/trac/htdocs$1
ScriptAliasMatch ^(.*) /usr/share/trac/cgi-bin/trac.fcgi$1
</VirtualHost>
}}}
As you can see, I avoided the lag by just reducing the timeout of FastCGI
to one second. This way, users don't notice that trac.fcgi gets a timeout.
But with increasing load on the server, one second might not be
sufficient.
I use:
* Fedora Core 3
* Apache 2.0.53
* Python 2.3.4
* Trac 0.9b2
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/2252>
The Trac Project <http://trac.edgewall.com/>
More information about the Trac-Tickets
mailing list