Advertisement

06.23.2008 at 04:23AM PDT, ID: 23507165 | Points: 500
[x]
Attachment Details

Tuning PHP5 and FCGID on Debian etch4

Asked by ReadyToGo in Apache Web Server, CGI Scripting, Debian Linux

Tags: Linux, libapache2-mod-fcgid, 1.10-2, OS: Debian etch4 - apache2-mpm-worker - PHP5

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/sock
IdleTimeout 30
BusyTimeout 30
ProcessLifeTime 360
SpawnScoreUpLimit 21000
MaxProcessCount 21000
DefaultMaxClassProcessCount 21000
IPCConnectTimeout 3
IPCCommTimeout 6
##############

And php-cgi script as follow:
##############
export PHPRC=/var/www/domain.ext/www/sys/conf
export TMP=/var/www/domain.ext/www/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/sys/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/sys/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

RegardsStart Free Trial
 
 
[+][-]06.23.2008 at 08:00PM PDT, ID: 21852212

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.23.2008 at 08:11PM PDT, ID: 21852248

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.23.2008 at 08:42PM PDT, ID: 21852353

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.24.2008 at 02:43AM PDT, ID: 21853791

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.24.2008 at 02:44AM PDT, ID: 21853797

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.24.2008 at 04:45AM PDT, ID: 21854582

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.24.2008 at 05:51AM PDT, ID: 21855099

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.24.2008 at 08:49AM PDT, ID: 21857051

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.28.2008 at 04:27AM PDT, ID: 21890276

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07.01.2008 at 05:27AM PDT, ID: 21906956

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628