How the tests were performed:
I wanted to simulate a VPS environment similar to a basic Linode. A base install of Ubuntu Server 10.04 was installed in VMWare with an older/slower 7200RPM sata drive for storage. This drive was not in use by any other system during the test, nor were any other VMs active on the host. The guest was given 512MB of RAM and 1 CPU core of the host's 8 cores. The host's CPUs are dual Xeon X5365 @ 3Ghz.
Apache 2.2 was installed along with nginx 0.7.65, later Apache 2.4 was compiled on this same system.
Testing was performed using Apache JMeter on an 8 core Xeon workstation running Windows 7 and 32GB of RAM with a 1Gb/s link to the VMWare host. Requests per second were determined by rounding off the throughput displayed in the Summary Report listener. Each test was run until the requests per second stabilized.
The Apache 2.2 server was only tested with the Prefork MPM, while the Apache 2.4 server was tested with both Prefork and Event. Apache's KeepAlive setting was on throughout the testing and set at 2 seconds.
Update:
I received several requests to post memory usage statistics so I've updated the Jquery test with memory results. Again, care was not taken to keep the Apache builds consistent. It concerns me that the Prefork build of Apache 2.4 was using so much memory compared to the other Apache builds. Take these results with a grain of salt, but trust that Nginx definitely uses significantly less memory than Apache.
Update 2 - Nginx 1.0.12:
I received some flak for using an older version of Nginx, so I tested with Nginx 1.0.12 and it was around 4% slower than the results shown here.
Test 1 - 21KB text file
| HTTP Server | Req/s |
|---|---|
| Apache 2.2 Prefork | 2220 |
| Apache 2.4 Prefork | 2250 |
| Apache 2.4 Event | 2300 |
| Nginx | 2600 |
Test 2 - 2B text file consisting of a single period.
| HTTP Server | Req/s |
|---|---|
| Apache 2.2 Prefork | 4400 |
| Apache 2.4 Prefork | 4700 |
| Apache 2.4 Event | 4810 |
| Nginx | 6650 |
Test 3 - jquery.min.js (92KB)
| HTTP Server | Req/s | Memory Usage |
|---|---|---|
| Apache 2.2 Prefork | 650 | 12MB |
| Apache 2.4 Prefork | 770 | 72MB |
| Apache 2.4 Event | 820 | 20MB |
| Nginx | 1000 | 2MB |
Test 4 - PHP output of phpinfo()
| HTTP Server | Req/s |
|---|---|
| Apache 2.2 Prefork | 525 |
| Apache 2.4 Prefork | 575 |
| Nginx FastCGI | 450 |

3 comments:
On 1 core it makes no sense. Run the tests on many CPUs, because this is what Apache's supposed to be good at: scalability as opposed to simple efficiency.
I find it rather interesting how so many people have run these benchmarks, come up with basically the same results, explained in detail ranging from none to extremely detailed, and continue to get picked on for some asinine reason.
Every benchmark that I've seen or run against the latest Apache and Nginx shows rather clearly that Nginx is still winning in terms of performance for both large and small systems.
In this particular test, you covered most all of your bases and yet you still get someone saying something to discredit all of your work.
(zomg, apache lost? well u didnt done it rite lol! o u did? well dat cuz ur puter wrong puter, get better buter)
Really?
This is definitely one of the better benchmark blog posts. I'll have to discredit your PHP test purely based on lack of information about how any of it was configured. Any chance you could try with php-fpm and a static number of children and set it to 10 (a common number for a linode vps)? I don't know if you can really mess with the way php works behind apache2.4. Something like that would be very nice to see.
Anyway... thanks for the coherent benchmark. Aside from PHP, I'd say you covered your backing for the benchmarks very well. I also like how you clarified what your use case in the benchmark was for.
nice page keep it up...
Thanks & Regards
Generic Viagra
Bimatoprost
Benoquin
Generic Propecia
Acyclovir cream
Post a Comment