We are having problems with some mod_fcgid settings to get them working 
properly. At this moment we have a testing setup running in vmware with 
just one simple virtualhost:

<VirtualHost *>
        SuexecUserGroup thomas thomas
        ServerAdmin [EMAIL PROTECTED]
        ServerName thomas.localhost

        IdleTimeout 10
        IdleScanInterval 5
        MaxProcessCount 0
        DefaultMaxClassProcessCount 1
        SpawnScoreUpLimit 0

        DocumentRoot /home/thomas/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        <Directory /home/thomas/www/>
                Options Indexes FollowSymLinks MultiViews ExecCGI
                AllowOverride Indexes
                Order allow,deny
                allow from all

                AddHandler fcgid-script .fcgi .php
                FCGIWrapper /var/www/thomas/php.fcgi .php

                RewriteEngine On
                RewriteCond %{HTTP:Authorization} ^(.+)
                RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]


        ErrorLog /var/log/apache2/error.log
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On


And in fcgid.conf:

<IfModule mod_fcgid.c>
  SocketPath /var/lib/apache2/fcgid/sock
  IPCConnectTimeout 20

And the wrapper script php.fcgi:

export PHPRC
exec /usr/bin/php5-cgi

Now we run a very simple php script which is loaded like 30 times in 
$time_start = microtime_float();
sleep( rand(1,3) );
$time_end = microtime_float();
$time = $time_end - $time_start;
echo "Did nothing in $time seconds\n";

 The browser opens this script 2-2-2 etc (possibly due to the 
maxSimultanousPersistentConnections setting in browsers). When we open 
this script however in multiple browsers a fatal DOS-like number of 
processes is forked, even when we use the settings above 
(MaxProcessCount = 0).
We understand that each 'main fcgi process' has 4 children, so 5 
processes in total. There appears however to be one 'main fcgi process' 
per (running) browser without a limit. When we close all browsers and 
neatly run the iframe-page in only one browser, then no more extra 
processes are forked.

How can we prevent that this many processes are forked? Ideally we want 
only a maximum of one 'main fcgi process'.

Some background information is that we also use the module xcache. This 
module loads php-opcode in a mmap shared between forked processes. So 
each time a new 'main fcgi process' is created the xcache re-caches all 
opcode for the php pages. When only one 'main fcgi process' with its 
children stays running the xcache also remains in memory for optimal 

(we also use suexec if that matters)

This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Mod-fcgid-users mailing list

Reply via email to