I'm a long time user of mod_fcgi and would like to start using mod_fcgid. I've
been running mod_fcgi with a custom patch of mine. I like to see if it could
be included in mod_fcgid or maybe you can give me an other way to accomplish
what I need without the patch. What I have is one C program that lives on a
linux server. I want to use a web browser as the UI. The C program is a
classic "one instance to one UI". If 5 people want to run this program I need
five separate and persistent copies of the program running, one for each
person. When one is done then the program exits.
What I've done is sym-linked my program to make unique program names
like:
program-1
program-2
program-3
etc..
Then each browser asks for a different name.
plus the patch that allows setting killInterval to 0, so the process manager
won't kill my process ever. Here are the settings:
-maxClassProcesses 1 -singleThreshold 1 -killInterval 0.
I know I could have done it with FastCGIExternalServer, but I wanted
everything to be dynamic.
Here is the patch.
Index: fcgi_pm.c
===================================================================
--- fcgi_pm.c (revision 674)
+++ fcgi_pm.c (working copy)
@@ -1925,11 +1925,14 @@
if(fcgi_dynamic_epoch == 0) {
fcgi_dynamic_epoch = now;
}
+ if (dynamicKillInterval != 0)
+ {
if(((long)(now-fcgi_dynamic_epoch)>=dynamicKillInterval) ||
((fcgi_dynamic_total_proc_count+dynamicProcessSlack)>=dynamicMaxProcs))
{
dynamic_kill_idle_fs_procs();
fcgi_dynamic_epoch = now;
}
+ }
}
if(!callWaitPid) {
@@ -2060,11 +2063,14 @@
fcgi_dynamic_epoch = now;
}
+ if (dynamicKillInterval != 0)
+ {
if ((now-fcgi_dynamic_epoch >= (int) dynamicKillInterval) ||
((fcgi_dynamic_total_proc_count+dynamicProcessSlack) >=
dynamicMaxProcs)) {
dynamic_kill_idle_fs_procs();
fcgi_dynamic_epoch = now;
}
+ }
read_ready = 0;
}
else if (dwRet == WAKE_EVENT) {
Index: fcgi_config.c
===================================================================
--- fcgi_config.c (revision 674)
+++ fcgi_config.c (working copy)
@@ -1067,7 +1067,7 @@
return invalid_value(tp, name, NULL, option, err);
}
else if (strcasecmp(option, "-killInterval") == 0) {
- if ((err = get_u_int(tp, &arg, &dynamicKillInterval, 1)))
+ if ((err = get_u_int(tp, &arg, &dynamicKillInterval, 0)))
return invalid_value(tp, name, NULL, option, err);
}
else if (strcasecmp(option, "-updateInterval") == 0) {
--
Computer Services
Ricardo Cantu
Vice President
Home office
3506 Buchanan St Suite C
Wichita Falls, TX 76308
(940) 696-3010
El Paso branch
14553 Desierto Lindo Ave
El Paso, TX 79928
(915) 219-7119