hi all,
i just switched from mod_php to mod_fcgid as we have a
multi-user-webserver and i wanted to use the benefits of per-user
executuion of php-scripts.

now we have huge problems with the stability of the webserver.

it's a multi-user-webserver (ubuntu  10.04.2,  Apache/2.2.14,
apache2-suexec 2.2.14-5, libapache2-mod-fcgid 2.3.4-2)

the server has 16 GB RAM
after stating the webserver, 10GB of ram are immediately consumed.
after running some minutes, some applications are also unavailable
before getting to the ram-limit, with error 500., for example :

call /data/homewww/user1/webdir/events/index.php with wrapper
/data/homewww/user1/webdir/cgi/php.fcgi
[notice] mod_fcgid: process
/data/homewww/user1/webdir/index.html(27558) exit(communication
error), terminated by calling exit(), return code: 254

later (15-20min) the ram ist almost full and most of the
php-applications are not available anymore.
in the apache error.log i can then see the following error:

Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[error] [client x.x.x.x] Premature end of script headers: index.php

I then need to restart the apache-server. after restart immediately 10
GB of ram are used. there are bwetwenn 150-250 php-cgi processes.

this is my fcgid.conf:


  FcgidConnectTimeout 20
  PHP_Fix_Pathinfo_Enable 1
  MaxRequestsPerProcess 10000
  IdleTimeout 60
  IdleScanInterval 30
  BusyTimeout 300
  BusyScanInterval 120
  ErrorScanInterval 6
  ZombieScanInterval 6
  ProcessLifeTime 60
  SpawnScoreUpLimit 150
  SpawnScore 1
  TerminationScore 2
  MaxProcessCount 500
  IPCConnectTimeout 30
  IPCCommTimeout 30

 DefaultMinClassProcessCount and DefaultMaxClassProcessCount are commented out

in my top  i see something like this:
 PID USER   PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
3510  user1   20   0  134m  10m  5472 S   35       0.1   0:07.07 php-cgi
 4402 user2   20   0  157m  22m   13m S   16       0.1   0:01.29 php-cgi
 3619 user3   20   0  153m  20m   15m S    6        0.1   0:01.28 php-cgi
 3609 user4   20   0  144m  21m  5632 S    4        0.1   0:00.39 php-cgi
 [..]
 3623 userN   20   0  140m  18m  5708 S    4        0.1   0:00.47 php-cgi

the fcgid-wrapper-script for each user looks like this:
#!/bin/sh
PHPRC="/data/homewww/user1/conf/"
export PHPRC
export TMPDIR=/data/homewww/user1/tmp
PHP_FCGI_CHILDREN=0
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=10000
export PHP_FCGI_MAX_REQUESTS
exec /opt/php/php-5.2/bin/php-cgi


this is my apache2.conf:
<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads    25
    MaxSpareThreads    75
    ThreadLimit            64
    ThreadsPerChild      25
    MaxClients            150
    MaxRequestsPerChild   0
</IfModule>

one thing i thought it could be the reason ist the value
"memory_limit" in the per-user php.ini
currently it is set to 64M. i already tried to reduce this value but
then some of the applications dont wotrk (typo3 for example)
a also have aeccelerator enabled for each user. could this be the reason?

this is the relevant configration in php.ini:
extension=eaccelerator.so
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/var/cache/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"


can someone please please give me some advices how to tune the values
PLEASE, currentlx i have no clue what to do.

regards, lowshoe

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Mod-fcgid-users mailing list
Mod-fcgid-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mod-fcgid-users

Reply via email to