Welcome! Log In Create A New Profile

Advanced

PHP-FPM Erratic Crashes

Posted by Ronan Chilvers 
Ronan Chilvers
PHP-FPM Erratic Crashes
February 03, 2011 09:12AM
Hi all

I'm hoping that you guys can help me diagnose a problem that we've
been seeing with a PHP-FPM installation over the past couple of
months. We run PHP-FPM on several servers using the dotdeb packages
on Debian Lenny. The server in question has the latest dotdeb packages
installed (php 5.3.5). All of our other servers have behaved
impeccably, even under high load. FYI, the specs of this particular
machine are:

Lenny 64bit
Dual Intel Xeon Quad-Core E5420
8GB RAM
2 x 15K HDD in hardware RAID1

The stack is NGinx 0.6.32 (debian package), MySQL 5.0.51 (debian
package), redis 1.2.6-1 (debian package), memcached 1.2.2 (debian
package) . PHP 5.3.5 is installed (as mentioned) from dotdeb and we
are using the following extensions:

curl, gd, geoip, mcrypt, memcache, mysql, tidy, xcache (opcode caching
only - var caching is turned off), phpredis - compiled from source
against 5.3.5 dev package

The problem: (!!)

We've been seeing seemingly random events where PHP-FPM simply stops
responding to requests and never comes back. This is happening at
least once a day, sometimes up to 10 or 15 times a day. We've set up a
small monitor script that connects to a /ping url and restarts PHP-FPM
if more than 3 attempts to ping fail (20 second delay). PHP-FPM is
running with 2 process pools, one for a legacy control panel (low
usage) and one for everything else. Slow log and backtracing are
turned off. I can post the configuration if required - didn't want to
make this post too massive!!

There doesn't seem to be a correlation with any traffic spikes or
other load on the server. The load average is almost always low when
these events occur (between 1 and 2 - the normal running level for
this machine). There is plenty of available RAM (~500M free and ~3G
cached). We've noticed that swap usage is high at ~2G and we regularly
see high paging both to physical RAM and swap space. MySQL is
configured to use InnoDB and has a quite conservative RAM allocation
of ~ 2G.

To give an idea of traffic, the server handles 4 sites, one of which
has reasonably high traffic at about 15K to 20K visitors per day.
Generally the stack is running at between 40 and 60 requests per
second. I know that this stack is able to handle far more than this
level of requests - we've had the same installation on a different
machine handle 100+ requests per second without a problem.

I would really appreciate any thoughts on how to diagnose what's going
on. Our client is keen for us to move to Apache and site stability has
been poor enough that its looking likely. However I would really like
to know what's going on!!!

Many thanks in advance for any advice

Cheers

Ronan
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 107
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready