Hi all,
it's first time i post here so i hope to respect rules of this board.
I have many server web apache2-mpm-worker with php5 as module.
I want increase performance and i want limit some websites trying mod_fcgid.
Now i have about 6000-8000 websites on each server (2 X AMD Opteron 275 Dual Core) and with php5 as module they work good ( load less than 5 score daily)
Problem is that, sometimes, one website cause high load web server.
I want to preview high load problem so i thought that with mod_fcgid or just fastcgi, i can limit processes for each website so that ONLY website that cause high load will have problem and not all others.
After some tuning I tried mod_fcgid with following options:
cat /etc/apache2/mods-enabled/
fcgid.conf
##############
AddHandler fcgid-script .fcgi .php
SocketPath /var/lib/apache2/fcgid/soc
k
IdleTimeout 30
BusyTimeout 30
ProcessLifeTime 360
SpawnScoreUpLimit 21000
MaxProcessCount 21000
DefaultMaxClassProcessCoun
t 21000
IPCConnectTimeout 3
IPCCommTimeout 6
##############
And php-cgi script as follow:
##############
export PHPRC=/var/www/domain.ext/
www/sys/co
nf
export TMP=/var/www/domain.ext/ww
w/sys/tmp
#export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=300
exec /usr/bin/php5-cgi $@
##############
This is not enough cause "looklikes" that process will never die
I reached about 1000-1200 sleeping process( most of them php5-cgi ) and 8GB DDR RAM were full and start swapping.
CPU is ok but RAM is full (on each php.ini memory limit is 24M)
If i stop apache2, php5-cgi still alive unless i kill them with kill command, manually.
With mod_php i do not have these probs so i would like to know how tuning fcgid with php5 to consume less memory and be sure that process are killed after timeout.
On error.log i can see these messages:
[notice] mod_fcgid: process /var/www/domain.ext/www/sy
s/env/php-
cgi(13093)
exit(idle timeout), terminated by calling exit(), return code: 0
or
[warn] mod_fcgid: process 13274 graceful shutdown timeouted, sending SIGKILL
or
[notice] mod_fcgid: process /var/www/domain.ext/www/sy
s/env/php-
cgi(13274)
exit(busy timeout), get stop signal 9
so looklikes that processes are killed but anyway there still be too many processes and after few hours websites are not visible anymore(apache2 and php5-cgi still running).
So i hope that someone can show me light
Sorry for this "long" question.
I hope to be clear.
Waiting for your answer
Regards
Start Free Trial