Apache 2.4 vs Nginx 1.412 May 2013
Having setup Apache 2.4 and Nginx 1.4 I wanted to see how they performed. I am not trying to do a scientific performance test here, I am just interested in how Nginx behaves because I haven’t used it before.
|Server||Samples||Average||Median||90% line||min||max||error %||Throughput||KB/sec|
Looking at the results it seems that in the beginning there is no big difference. The difference starts with bigger numbers where Nginx shows higher average numbers because it fails to respond or responds very late in some cases. Although the average numbers are high because of the reasons managed you can see that most calls are handled faster.
Nginx is supposed to use less resources so I used the “uptime” command before starting the test and right after the test, here are the results (measured only for test: 1000 users, 1000 times):
|Server||Average load before the test||Average load after the test|
|apache||1,55, 0,33, 0,11||18,74, 9,97, 4,02|
|apache||0,69, 0,16, 0,05||1,02, 0,77, 0,36|
It clearly shows that Nginx uses less CPU than Apache for the same work, the difference is so big you can see it by just looking at the system monitor.
I like what I see from Nginx and I am definitely going to play more with it.