[FASTCGI] apache-2.2.6, suexec, mod_fastcgi, on FreeBSD; php-fcgi processes not reused

Peter Veerman pveerman at nemo.kabelfoon.net
Fri Sep 4 16:33:56 EDT 2009


Hello,

I have set up apache-2.2.6 + mod_fastcgi-2.4.2-1 and suexec according to 
the example shown at: 
http://blog.chty.org/post/2007/10/28/Apache2-mod_fastcgi-suexec-on-debian-etch

 From what I can see is that the already started php processes are never 
reused. For every request a new php process is spawned which causes my 
server to suffer under the load of the many many php processes. My 
config is;

In httpd.conf:
<IfModule mod_fastcgi.c>
        FastCgiIpcDir /usr/local/www/fcgi_ipc/tmp
        FastCgiWrapper /usr/local/sbin/suexec
        FastCgiConfig -killInterval 30 -idle-timeout 200 
-listen-queue-depth 100 -maxClassProcesses 20 -maxProcesses 90 
-multiThreshold 1 -singleThreshold 0 -restart -flush -pass-header 
HTTP_AUTHORIZATION
</IfModule>

In any of the vhosts: 
<VirtualHost *:80>
    SuexecUserGroup xxx xxx
    ScriptAlias /php-fastcgi/ /data/hosting/xxx/php-fastcgi/
    Action php-fastcgi /php-fastcgi/php5-fcgi.sh
    AddType application/x-httpd-php .php
    AddHandler php-fastcgi .php
etc.

in php5-fcgi.sh:
#!/bin/sh
#PHPRC="/usr/local/etc/php.ini"
PHPRC="/hosting/xxx/php-fastcgi/php.ini"
export PHPRC
PHP_FCGI_CHILDREN=3
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=200
export PHP_FCGI_MAX_REQUESTS
exec /usr/local/bin/php-cgi

when the whole setup runs pstree gives;

??? 00001 root /sbin/init --
 ???? 23738 root /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23739 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ? ???? 23767 userA /usr/local/bin/php-cgi
   ? ? ???? 23768 userA /usr/local/bin/php-cgi
   ? ? ???? 23769 userA /usr/local/bin/php-cgi
   ? ? ???? 23770 userA /usr/local/bin/php-cgi
   ? ???? 23869 userB /usr/local/bin/php-cgi
   ? ? ???? 23870 userB /usr/local/bin/php-cgi
   ? ? ???? 23871 userB /usr/local/bin/php-cgi
   ? ? ???? 23872 userB /usr/local/bin/php-cgi
   ? ???? 23959 userB /usr/local/bin/php-cgi
   ? ? ???? 23960 userB /usr/local/bin/php-cgi
   ? ? ???? 23961 userB /usr/local/bin/php-cgi
   ? ? ???? 23962 userB /usr/local/bin/php-cgi
   ? ???? 26665 userF /usr/local/bin/php-cgi
   ? ? ???? 26666 userF /usr/local/bin/php-cgi
   ? ? ???? 26667 userF /usr/local/bin/php-cgi
   ? ? ???? 26668 userF /usr/local/bin/php-cgi
   ? ???? 29711 userA /usr/local/bin/php-cgi
   ? ? ???? 29712 userA /usr/local/bin/php-cgi
   ? ? ???? 29713 userA /usr/local/bin/php-cgi
   ? ? ???? 29714 userA /usr/local/bin/php-cgi
   ? ???? 30459 userC /usr/local/bin/php-cgi
   ? ? ???? 30460 userC /usr/local/bin/php-cgi
   ? ? ???? 30461 userC /usr/local/bin/php-cgi
   ? ? ???? 30462 userC /usr/local/bin/php-cgi
   ? ???? 34297 userD /usr/local/bin/php-cgi
   ? ? ???? 34298 userD /usr/local/bin/php-cgi
   ? ? ???? 34299 userD /usr/local/bin/php-cgi
   ? ? ???? 34300 userD /usr/local/bin/php-cgi
   ? ???? 37669 userE /usr/local/bin/php-cgi
   ? ? ???? 37670 userE /usr/local/bin/php-cgi
   ? ? ???? 37671 userE /usr/local/bin/php-cgi
   ? ? ???? 37672 userE /usr/local/bin/php-cgi
   ? ???? 49464 userF /usr/local/bin/php-cgi
   ? ? ???? 49465 userF /usr/local/bin/php-cgi
   ? ? ???? 49466 userF /usr/local/bin/php-cgi
   ? ? ???? 49467 userF /usr/local/bin/php-cgi
   ? ???? 52943 userA /usr/local/bin/php-cgi
   ? ? ???? 52944 userA /usr/local/bin/php-cgi
   ? ? ???? 52945 userA /usr/local/bin/php-cgi
   ? ? ???? 52946 userA /usr/local/bin/php-cgi
   ? ???? 53089 userA /usr/local/bin/php-cgi
   ? ? ???? 53090 userA /usr/local/bin/php-cgi
   ? ? ???? 53091 userA /usr/local/bin/php-cgi
   ? ? ???? 53092 userA /usr/local/bin/php-cgi
   ? ???? 53463 userA /usr/local/bin/php-cgi
   ? ? ???? 53464 userA /usr/local/bin/php-cgi
   ? ? ???? 53465 userA /usr/local/bin/php-cgi
   ? ? ???? 53466 userA /usr/local/bin/php-cgi
   ? ???? 53489 userA /usr/local/bin/php-cgi
   ?   ???? 53490 userA /usr/local/bin/php-cgi
   ?   ???? 53491 userA /usr/local/bin/php-cgi
   ?   ???? 53492 userA /usr/local/bin/php-cgi
   ???? 23740 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23741 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23742 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23743 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23744 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23745 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23746 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23747 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23748 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23749 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23750 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23751 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23752 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23754 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23756 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23757 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23758 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23759 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23760 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23761 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23762 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23763 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23764 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23765 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23766 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23771 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23772 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23773 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23774 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23775 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23776 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 23777 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 38113 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 38114 www /usr/local/sbin/httpd -D DEFAULT_VHOST
   ???? 38115 www /usr/local/sbin/httpd -D DEFAULT_VHOST


regards,

Peter Veerman






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.pins.net/mailman/private.cgi/fastcgi-developers/attachments/20090904/917a5277/attachment.html>


More information about the FastCGI-developers mailing list