I have a Debian Squeeze Lighttpd server with PHP and MySQL, and also with XCache and Varnish set up.
I am quite new to this, but have tried as hard as I can to resolve this problem with no success.
Whether I use Lighttpd or Nginx or XCache or APC the problem remains.
Basically the server chugs along processing PHP perfectly fine, the RAM looks fine etc. Then suddenly it seems to grind to a halt and the PHP-CGI (or FPM) processes stack up and stack up, eating up all of my quad core CPU power and causing the whole server to become almost entirely non-responsive.
I have 4 sites on my server, 3 of which are quite low traffic and demand, and one of which is quite intensive and busy. So it's almost definitely that site causing it. However we got that site working on this (VPS) server before with a cPanel setup (that I want to avoid now due to cost and preference of Debian, etc.
Even when I remove all AJAX from the intensive site and lower traffic, it still does it.
There are also no obvious errors reported in the PHP, MySQL or lighttpd logs (I got them all working and check them regularly).
Here is the PHP part of my lighttpd.conf:
http:// pastebin.com/JwbFJ4YQ
(max requests set to 500 as recommended here, not 100% sure it's correct, but of course the problem happened in nginx too anyway!)
and here is my php.ini:
http:// pastebin.com/XHH0YMTd
and my MySQL my.cnf:
http:// pastebin.com/YPFjdfmf
Any thoughts? XCache only has 64mb allocated to it but that's what they recommended to start with and it never seems to use it all in its admin CP (that I notice). Both Varnish and XCache are working fine I think and the sites respond VERY fast until this lock up event happens (which it predictably always does).