ID: 28343 Comment by: pqf at tebie dot com Reported By: webmaster at whocares dot de Status: Open Bug Type: CGI related Operating System: SuSE Linux 9.0 PHP Version: 4.3.6 New Comment:
try mod_fcgid at http://fastcgi.coremail.cn, one of it's goals is reducing the number of processes. Previous Comments: ------------------------------------------------------------------------ [2004-05-10 08:38:03] webmaster at whocares dot de Description: ------------ As stated in the summary, I'm running PHP in FastCGI mode with Apache 2.0.49 and mod_fastcgi 2.4.2. After upgrading from PHP 4.3.5 to PHP 4.3.6 I noticed that a lot more PHP CGIs were running on the server. Before it were 10, afterwards it were 79. It seems to me that instead of starting the specified amount of PHP CGIs per active Apache server (5, see code below) with PHP 4.3.6 it will start the specified number of CGI provcesses for every instance (child process) of the Apache server. Compile settings for PHP 4.3.5 and 4.3.6: ./configure \ --disable-ipv6 \ --enable-calendar \ --enable-ftp \ --enable-force-cgi-redirect \ --enable-magic-quotes \ --enable-mbstring \ --enable-mbregex \ --enable-memory-limit \ --enable-mime-magic \ --enable-sigchild \ --with-bz2 \ --with-config-file-path=/etc \ --with-curl \ --with-db4 \ --with-freetype-dir \ --with-gd \ --with-gettext \ --with-jpeg-dir \ --with-mcrypt \ --with-mhash \ --with-mysql=/usr \ --with-openssl \ --with-png-dir \ --with-t1lib \ --with-tiff-dir \ --with-xmlrpc \ --with-zlib \ --enable-fastcgi Integration in Apache: <IfModule mod_fastcgi.c> ScriptAlias /fcgi-bin/ /opt/apache/fcgi/ <Location /fcgi-bin/> Options ExecCGI SetHandler fastcgi-script </Location> # Alias /fcgi-bin/ /opt/apache/fcgi/ FastCgiServer /opt/apache/fcgi/php-fcgi -processes 5 AddType application/x-httpd-php .php Action application/x-httpd-php /fcgi-bin/php-fcgi </IfModule> The CGI version of PHP is copied to /opt/apache/fcgi using cp sapi/cgi/php /opt/apache/fcgi/php-fcgi Expected result: ---------------- With PHP 4.3.5, evaluating the running processes will show a reasonable small number: linux:~/soft/php-4.3.5 # ps ax | grep php-fcgi | wc -l 7 linux:~/soft/php-4.3.5 # ps ax | grep httpd2 | wc -l 32 linux:~/soft/php-4.3.5 # Actual result: -------------- With PHP 4.3.6 the same command shows a lot more running PHP CGIs: linux:~/soft/php-4.3.6 # ps ax | grep php-fcgi | wc -l 47 linux:~/soft/php-4.3.6 # ps ax | grep httpd2 | wc -l 32 linux:~/soft/php-4.3.6 # ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28343&edit=1