Nginx VS Apache perfomance

I had old develop server.

Nginx and Apache running on the same port, but on different ip addresses.

I decided to test the perfomance of YII demo blog with a help of apache benchmark and APACHE JMETER.

First blog is running on Apache without nginx on frontend, second is on Nginx + php5-fpm

Current versions are:

yii is 1.1.15;

Apache/2.4.7 (Ubuntu);

nginx/1.4.6 (Ubuntu));

PHP 5.5.9-1ubuntu4.4 with Zend OPcache v7.0.3.

The blog application has enabled: CMemCache and COutputCache.

Yesterday the results were unexpected: blog that is running on Apache has better perfomance then on nginx.

Today I made some experiments on setting up config to nginx and fpm. The perfomance of two blogs become equal. But is is also unexpected to me. I read about huge advantage of Nginx compared to Apache.

I do not see the advantage. Is it fairy tales??? Or I need to have more experiments on nginx configuration?

I can not attach my nginx and php-fpm configuration because it depend on different params, but I can attach the results of tests.



How can I explain such unexpected results, and what I must choose (apache or nginx) for my project, that could be highloaded.

You are hitting the blog ( and therefore the webserver ), only on the first of 1000 transactions on each test.

After that you are only testing the performance of the Cache code.

I expect that after disabling the cache you will see a significant difference.

For example with requests per second, Apache may drop to 9 and nginx may drop to 40.

and response times will grow dramaticly for Apache, and grow some for nginx.

If you can, run new tests and post the results here for others to see.


I think use Apache bestter