httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From roberto blanko <robertobla...@gmail.com>
Subject [users@httpd] FastCGI causes website to hang
Date Tue, 01 Mar 2011 15:10:40 GMT
Hello fellow Apache community,

we just switched from our old hosting platform (which used to run PHP as an
Apache module) to Plesk which (in our configuration) runs PHP through
FastCGI. In general we prefer the principle and security features of
FastCGI, so we want to stick to it.

However, since we started migrating some bigger websites (bigger means more
hits a day) we encounter regular stability problems. After some time (can be
some minutes to some hours) some websites just don't react anymore. They
keep loading and loading until Apache quits with a timeout.

The only way to solve this issue, is to restart apache. When the server
hangs `ps aux | grep php` shows the following output:

user2  9708  0.0  1.1 263772 37544 ?        S    Feb21   0:04
/usr/bin/php-cgi -c /var/www/vhosts/user2.domain.tld/conf/php.ini
user2  9836  0.0  1.2 264028 37812 ?        S    Feb21   0:03
/usr/bin/php-cgi -c /var/www/vhosts/user2.domain.tld/conf/php.ini
user1 15775  0.1  1.4 266704 45476 ?        S    07:36   0:24
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini
user1 15780  0.0  1.4 266704 45408 ?        S    07:36   0:14
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini
user1 15790  0.1  1.4 266588 45244 ?        S    07:36   0:25
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini
user3 23580  0.0  1.0 261880 34020 ?        S    08:17   0:00
/usr/bin/php-cgi -c /var/www/vhosts/user3.domain.tld/conf/php.ini
user1 23806  0.2  1.1 264128 37644 ?        S    11:40   0:01
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini
user3 24230  0.0  0.8 259016 26112 ?        S    04:53   0:00
/usr/bin/php-cgi -c /var/www/vhosts/user3.domain.tld/conf/php.ini
user1 27796  0.4  1.0 259772 33556 ?        S    11:50   0:00
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini
user1 27831  0.2  1.1 264124 37616 ?        S    11:51   0:00
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini
user1 27857  0.2  1.0 259772 33292 ?        S    11:52   0:00
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini
user1 27963  0.2  1.1 262480 36284 ?        S    11:52   0:00
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini
user1 28001  0.2  0.9 261580 28856 ?        S    11:52   0:00
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini
user1 28012  0.1  0.9 261596 28860 ?        S    11:52   0:00
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini
user1 28037  0.3  0.8 260548 27712 ?        S    11:53   0:00
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini
user1 28042  1.3  1.1 263600 36044 ?        S    11:53   0:00
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini
user1 28058  0.7  1.1 263852 36124 ?        S    11:53   0:00
/usr/bin/php-cgi -c /var/www/vhosts/user1.domain.tld/conf/php.ini

If I keep waiting for some time the PHP processes change slightly and are
being replaced over time by processes having 0:00 all the time.

We already tried to increase some numbers in the FastCGI-settings, but it
didn't help. No matter how high we set FcgidMaxProcesses and
FcgidMaxProcessesPerClass: At the time the server crashes, we only have
about 10 to 20 running processes - never more.

This is how our current config looks like:

<IfModule mod_fcgid.c>
  FcgidIPCDir /var/run/mod_fcgid/sock
  FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm

  FcgidIdleTimeout 40
  FcgidProcessLifeTime 30
  FcgidMaxProcesses 1000
  FcgidMaxProcessesPerClass 100
  FcgidMinProcessesPerClass 25
  FcgidConnectTimeout 30
  FcgidIOTimeout 130
  # PHP's max_execution time is 120, so give FCGI 10 secs extra
  FcgidInitialEnv RAILS_ENV production
  FcgidIdleScanInterval 10
</IfModule>

The error_log doesn't show anything suspicious besides some lines from time
to time:
mod_fcgid: process 23786 graceful kill fail, sending SIGKILL

Do you have any ideas what the problem could be? Any help would be very
appreciated. If you need more specific information, just ask for it and I'll
take a look at the server. But since I have not even the slightest idea,
what the cause could be, I'm not sure what to post here.

Regards
roberto

Mime
View raw message