FCGI app reloading on every request

John Nagle nagle at animats.com
Tue Sep 4 11:18:04 EDT 2007


Michael Ströder wrote:
> John Nagle wrote:
> 
>>    What's actually happening is that FCGI isn't running at all.
>>My .fcgi file is being executed by Apache's CGI handler, and
>>"fcgi.py" recognizes this, then reads the parameters as if
>>a CGI program.  So it works just like a CGI program: one
>>load per request.  Not sure why Apache is doing that yet.
>>I'm looking at Apache configuration files now.
> 
> 
> Are you running mod_fastcgi oder mod_fcgid?

    I'm using mod_fcgid.

    This is running on a dedicated server at APlus.net,
running Red Hat Fedora Core 6, Python 2.5, and managed with Plesk 8.2.
I just turned on fcgid from the Plesk control panel ("Physical hosting
setup page for domain", checked "FastCGI"), and enabled the standard
FCGI configuration, which is actually mod_fcgid.

    The Python app is launched from "cgi-bin" with a file ending in
".fcgi".  It uses Alan Saddi's "fcgi.py" module to interface with
an FCGI server.  Python programs that use "fcgi.py" will also run
as standard CGI programs, for debug purposes.  And that's what's
happening.  I modified my test Python program to patch
"fcgi.CGIrequest._end" with a version that logged its calls,
and that's being called.  This indicates that "fcgi.py" is running
in CGI mode, not FCGI mode.  My test program is reloaded for every
HTTP request, as indicated by debug output, so it really is running
in CGI mode, with the expected low performance.

   What's wierd is that the ".fcgi" suffix files get executed at all.
I'd expect them to be either ignored or run properly with FCGI.

				John Nagle





More information about the Python-list mailing list