How many fast-cgi processes to use with PHP-FPM and NginX

fastcgiphp5

Does anyone know of a good source out there – or possibly can answer this in here – that can guide me as to how many Fast-cgi processes and Nginx processes I need to have running to serve a moderatly popular website. Between 75-100k pageview / day, quite intensive PHP-filled pages with decent cache for the heavy queries in mysql.

I'm using Apache mod_php today and is relatively new to running php as cgi but the early setup I've done using APC + Memcache + Nginx + PHP-FPM (fast cgi) on PHP 5.3.0 is very fast and not consuming too much memory under very light load. However, I'm unsure how I could test this under heavy load without moving my most popular site on it but I don't want to do that until I know if my current settings of 5 cgi processes and 5 nginx processes is enough.

Thanks

Best Answer

I recommend Siege over ab (Apache Bench).

Also, note that current PHP-FPM releases support Static as well as Dynamic threads (so always 10, vs 5-30, for instance). It would be good to test that while you're at it.

I haven't yet found a magic number, but it seems that the default of 10 static threads is good for 250-300 requests per second, on a single core, 1gb ram instance at SoftLayer, with an availability rate of ~90-95%.