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>
        <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]

        </Directory>

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


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

</VirtualHost>

And in fcgid.conf:

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

And the wrapper script php.fcgi:

#!/bin/sh
PHPRC="/etc/php5/cgi/"
export PHPRC
PHP_FCGI_CHILDREN=4
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php5-cgi

Now we run a very simple php script which is loaded like 30 times in 
iframes:
$time_start = microtime_float();
sleep( rand(1,3) );
require('pclzip.php');
$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 
performance.

(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
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mod-fcgid-users mailing list
Mod-fcgid-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users

Reply via email to