I'm running Drupal and trying to figure out the best stack to serve it. Apache + mod_php or Nginx + PHP-FPM
I used ApacheBench (ab) and Siege to test both setups and I'm seeing Apache performing better. This surprises me a little bit since I've heard a lot of good things about Nginx + PHP-FPM. My current Nginx setup is something that is a bit out of the box, and the same goes for PHP-FPM
What optimizations I can make to speed up the Nginx + PHP-FPM combo over Apache and mo_php ? In my tests using ab, Apache is outperforming Nginx significantly (higher requets/second and finishing tests much faster)
I've googled around a bit, but since I've never using Nginx, PHP-FPM or FastCGI, I don't exactly know where to start
PHP v5.2.13, Drupal v6, latest PHP-FPM and Nginx compiled from source. Apache v2.0.63
ApacheBench Nginx + PHP-FPM
Server Software: nginx/0.7.67
Server Hostname: test2.com
Server Port: 80
Concurrency Level: 25
---> Time taken for tests: 158.510008 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
---> Requests per second: 6.31 [#/sec] (mean)
Time per request: 3962.750 [ms] (mean)
Time per request: 158.510 [ms] (mean, across all concurrent requests)
Transfer rate: 181.38 [Kbytes/sec] received
ApacheBench Apache using mod_php
Server Software: Apache/2.0.63
Server Hostname: test1.com
Server Port: 80
Concurrency Level: 25
--> Time taken for tests: 63.556663 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
--> Requests per second: 15.73 [#/sec] (mean)
Time per request: 1588.917 [ms] (mean)
Time per request: 63.557 [ms] (mean, across all concurrent requests)
Transfer rate: 103.94 [Kbytes/sec] received
Here are some possibilities for this:
Post back with these details.
Also, try apache + mod_fastcgi + apc + php-fpm.
And, if you are using the if condition in nginx for rewrite rules, switch to try_files instead. if sometimes has performance issues.
Is it possible that you have APC or another accelerator enabled with apache? I agree with the poster above that more information about your configuration is needed.