Running a web server isn’t necessarily as easy as it used to be. With more and more high speed users requesting resources from our web servers, web server performance is becoming an important focus with web entrepreneurs. With resources such as social networks, unexpected high server loads can be generated by a single user sharing a link to your web server. DoS attacks can also play a large role in bringing your server down from a high volume of requests, often without warning. If you’ve never had a high volume traffic spike before, it is only a matter of time before you do.
With today’s dynamic websites, web server performance plays a large role in handling an unexpected traffic spike. Although dynamic pages don’t seem to take longer to load on a web server than a static page, heavy server loads (more than 20 concurrent users) result in exponentially long delays in a web server’s response time.
Nginx (pronounced ENGINE-X) is a relatively new web server that is highly praised for it’s performance under high server loads. Although competitor web server software such as Apache offers more features, Nginx is designed primarily with web server performance in mind. Nginx currently has a 6.62% market share in the busiest sites on the Internet, as referenced by Netcraft’s December 2010 Web Server Survey. Nginx’s market share might seem small, but in the highest traffic sites, changes in server software don’t happen overnight.
http://news.netcraft.com/archives/2010/12/01/december-2010-web-server-survey.html
With Nginx’s rising market share, we have to wonder what the performance advantage of switching to Nginx over Apache is. The only real way to show Nginx’s performance advantage is to compare it with a popular web server software solution, such as Apache. According to Netcraft, Apache currently holds the highest market share of web servers.
When I recently benchmarked Apache and Nginx performance, there were several trends that I noticed. Rather than post the hits/second, CPU load, and page render times, I’ve decided instead to post the trends that I noticed while performing this benchmark. Next week, I will post the exact benchmark scores of each server application, as well as my conclusion. Here were my observations on the way Nginx and Apache responded to a high amount of concurrent users:
- Apache and Nginx begin to show noticeable performance loss at around 25-35 concurrent users, averaging around 420 transactions per minute. These are, by far, not normal traffic loads. Bear these numbers in mind when comparing Apache and Nginx performance- under the conditions of the test that I performed, traffic was non-typical.
- Once failed transactions begin to occur (Apache’s failure point was at around 55-60 concurrent users, Nginx at 180 concurrent users), Apache’s failure rate at higher concurrent users was exponentially higher, whereas Nginx’s failure rate was linearly higher. When Apache was tested with 200 concurrent users, the failure rate was 24%. When Apache was then tested with 220 users, the failure rate grew to 48%. When Nginx was tested with 200 users, the failure rate was 5%. Nginx’s failure rate finally reached 20% at 280 concurrent users.
- At a high number of concurrent users (200), transactions per second were at 7 for Nginx, and 4 for Apache. At 280 concurrent users, Apache’s transactions per second dropped to a mere 1.66 transactions per second. What this means is that Apache took longer to successfully complete a transaction, at an exponentially larger rate. Nginx’s transactions per second was still at 7.18 transactions per second, at 280 concurrent users.
Next week, I will post the exact benchmark numbers, test conditions, and my conclusion on the test.
Tags: Apache, Nginx, Server Performance

