mod_fcgid Slow Startup on Ubuntu Fix 1

Posted by Tony Buser Fri, 28 Jul 2006 01:20:00 GMT

I recently switched to using modfcgid instead of modfastcgi. So far its nice and fast... except for the first hit after a period of inactivity. This is because fcgid kills off idle processes and it takes an annoyingly long time to start one up on this server. It turns out there is an option to set a minimum number of processes, however the version of mod_fcgid on Ubuntu Breezy doesn't have it. Here's how I installed it:

sudo apt-get install apache2-dev

Download mod_fcgid 1.09 or greater

Edit it's Makefile and change top_dir = /usr/share/apache2

make

cp .libs/mod_fcgid.so /usr/lib/apache2/modules

Edit /etc/apache2/mods-available/fcgid.conf and add a line that says DefaultMinClassProcessCount 3 and restart apache.

The first hit after a restart will be slow, but from then on it will maintain at least DefaultMinClassProcessCount processes.