CentOS 5 upgrade mod_fcgid and other issues

CentOS Linux 5.8
Webmin version 1.590
Virtualmin version 3.94.gpl GPL
Apache/2.2.3 / MPM_Worker
PHP 5.2.17 from the bleeding edge repository
mod_fcgid.i386 2.2-11.el5

Recently I started using my Virtualmin VPS extensively, installing virtual servers working in FCGId mode. Immediately I discovered a constant growth in the RAM memory used. There was a single php-cgi process for every virtual server in the memory (as expected), that stays forever (causing the problem).

The general idea of FastCGI is to keep the process in the memory as long as possible, which speeds up the processing greatly, but it should also give you options to control the spawning and killing the processes. A configuration in which all the processes stay forever in the memory is good if you have few virtual servers and a lot of memory (to fit them all and still have memory for other server processes), but in my case is not working at all (I have small memory and a lot of virtual servers).

There are couple of control options that can keep the number of the processes under some amount (more on that here: https://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html). Mostly two of them are IdleTimeout and MaxProcessCount which should let you control the resources of the server pretty good.

In my configuration none of this worked initially sending me to a long debugging.

Making IdleTimeout to work is described here: http://www.apachelounge.com/viewtopic.php?t=2563

In short you should set-up DefaultMinClassProcessCount 0

This let me control the idle time before a process is killed per virtual server letting me to kill non-important faster and keep some of them forever.

Though I need to combine this with MaxProcessCount to not let the processes to fill all the memory. This turns to be a bug in mod_fcgid, as described here:


a patch is proposed and also applied officially to the mod_fcgid 2.3.6 as described here:


Unfortunately in CentOS 5 we have mod_fcgid 2.2-11.el5

How can I upgrade mod_fcgid to 2.3.6 or newer?

A newer version is available here: http://pkgs.org/centos-5-rhel-5/atomic-i386/mod_fcgid-2.3.5-2.el5.art.i386.rpm.html but is it compatible with Virtualmin?

I cannot test, because we are already in production and I cannot risk killing the VPS…

If this is working maybe you can publish it in the bleeding edge repo?

Thanks for any information/test/time spent!!!

Kind regards,