[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-httpd-users
Subject:    [users@httpd] Issues with mod_fcgid and multi-threaded FastCGI application
From:       Brett Gmoser <bgmoser () codexterous ! com>
Date:       2010-08-30 21:53:47
Message-ID: 4C7C286B.6020703 () codexterous ! com
[Download RAW message or body]

Hello all,

I'm looking to migrate from my current mod_fastcgi configuration to 
mod_fcgid.  Since my FastCGI server (the application I write) is a big 
large and unwieldy, currently I use mod_fastcgi to spawn five instances 
of my server application, which in turn spawns about 400 threads 
internally which handle incoming requests in a multi-threaded fashion. 
This works okay with mod_fastcgi - this is a busy httpd servicing an 
average of around 75 requests per second. An odd part of this server is 
that many of the requests may take up to twenty seconds to complete due 
to back-end processing with third party APIs, the processing time is not 
within my control (just mentioning this in case it matters).

At any rate, this all works pretty well with mod_fastcgi (although 
mod_fastcgi is a bit buggy).  My problem is that in migrating to 
mod_fcgid (supposedly, I shouldn't need to make any changes to my 
FastCGI application - just configure mod_fcgid and use that instead of 
mod_fastcgi), it seems mod_fcgid isn't aware of the fact that my server 
is multi-threaded and is able to handle more than one request.  Thus, 75 
requests per second on five servers queues up pretty fast, and if I can 
get it to eventually answer a request it'll take around five minutes to 
do so.

There are no errors in the error log - I don't think there would be, 
because this is related to volume that mod_fcgid doesn't think my 
application can handle, and everything just fails silently.  Here's my 
mod_fcgid configuration, from my httpd.conf:

<IfModule fcgid_module>
   AddHandler fcgid-script .fcgi
   FcgidBusyScanInterval 10
   FcgidBusyTimeout 300
   FcgidConnectTimeout 30
   FcgidErrorScanInterval 1
   FcgidIdleScanInterval 5
   FcgidIdleTimeout 30
   FcgidIOTimeout 300
   FcgidIPCDir /var/run/fcgid.sock
   FcgidMaxProcesses 500
   FcgidMinProcessesPerClass 4
   FcgidMaxProcessesPerClass 50

   # FastCGI processes will be terminated after handling this many 
requests - we don't want this. 0 disables.
   FcgidMaxRequestsPerProcess 0
   FcgidZombieScanInterval 1
</IfModule>

I've combed the mod_fcgid documentation over a few times, and it doesn't 
mention anything about multi-threaded FastCGI servers.  I'd appreciate 
any insight that anybody could offer on this.

Thanks!

Brett Gmoser




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic