PHP-FPM Performance

Reinis Rozitis r at
Tue Dec 30 00:32:27 MSK 2008

>I forgot to add.
> Would it be more beneficial to have NGinx pass off the PHP requests to
> Apache as it runs PHP as a module?

In my opinion tottaly no (although people sometimes make proxy setups to 
pass the dynamic requests back to apache backend but handle the static via 
nginx - still its often because of some apaches features like php_flag 

Although you can try to play arround with the apache MPM modules - prefork 
is still the common mechanism which means that for each request a new 
process is forked/launched and after it finishes the child killed..
PHP childs in fastcgi mode live much longer (can be specified) and dont 
consume cpu resources just on spawning also something like persistant 
connections to DBs or other services work much better instead of dieing each 
time with apache.

Well initially it seems something wrong with your setup/performance 
results - at first getting only 1.5k req/sec for static content is somehow 
low ..You should be able to get 15-30k and even more requests per second (at 
least with 'ab' testing one file).. Of course php is much slower but still a 
simple 'hello world' on a single box should be able to manage up to 2k req/s 

So either the box is kinda weak or you havent tweaked some system settings 
like max open files or tcp params.


More information about the nginx mailing list