Bug 52174 - Allow hard lower-limits on the number of fcgi service processes
Summary: Allow hard lower-limits on the number of fcgi service processes
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_fcgid (show other bugs)
Version: 2.4-HEAD
Hardware: All Linux
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2011-11-13 15:45 UTC by Danny Sadinoff
Modified: 2011-11-16 12:59 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Danny Sadinoff 2011-11-13 15:45:22 UTC
I have FCGI processes that take a long time (~30 seconds) to start and initialize.  

mod_fcgid's approach is to fork new ones on demand, but that often takes too long in my scenario.

My goal is to ensure that there are at least N of them spun up and ready at any time.   

The docs say that FcgidMinProcessesPerClass enforces a...

 "minimum number of processes that will be retained in a process class after finishing requests"

My suggestion is to create a new config variable, say "FcgidHardMinProcessesPerClass" which would be the minimum number of processes that ought to exist for a class at all times, even before the first request arrives.  If the number of servers dips below that amount, it would fork a new one.
Comment 1 Danny Sadinoff 2011-11-16 12:59:28 UTC
If mod_fcgid is tasked with maintaining client processes before the first request, that puts it in the uncomfortable position of having to make up requests. 

An alternate approach might be to promise that the first X requests will spawn unconditionally, making it more predictable how to front-load the initial spawning requests.