Channels ▼

Open Source

Is Nginx Scalability Beating Apache?

The open source web server Nginx has been winning an increasing amount of interest among the developer community in recent months. This is the finding of Internet research analysts Netcraft in its January 2012 review of the world web space. Of the 583 million sites now estimated to be on the Internet, Nginx added 6.9 million new hostnames in the last month of 2011.

Acknowledging the existence of competitors in this market, cofounder of Nginx Andrey Alexeev explained that while Apache was always meant to be a general purpose web server, his company's offering has set out to "overcome certain barriers in Apache architecture" as he puts it; i.e., the associated application software. Nginx is said to interact with application servers, with memcached/NoSQL solutions, and can put on a fair job of handling SSL too. It can also do HTTP streaming for FLV/MP4 videos and load balance across backend applications.

Speaking directly to Dr. Dobb's, Alexeev said that Nginx is a good choice to solve concurrency problem and optimize latency at the front end part of a website. One user is quoted as saying, "If it's a lower concurrency site where the bottleneck is down to PHP or Ruby or whatever processing issue, then Nginx is less helpful. In those cases we need to look more into caching of code and data. Once caching is in place, Nginx may be great if it still needs more of a traffic boost."

Alexeev says that many developers are now replacing Apache with Nginx as they want to try something new and "better suited" to a layered architecture. "They want to switch to a different architecture in regards to integration with the applications; that is, switch from mod_php or mod_perl with Apache to php-fpm or fastcgi/perl with Nginx. There are several reasons why it might be a good idea to switch — ranging from a better utilization of hardware resources (and a better performance) to something like improved security and making the entire configuration more flexible," said Alexeev.

He continued, "The Ruby on Rails community appreciated Nginx a while ago, and there have been many followers among Ruby developers. With third-party software vendors like Passenger/mod_rails for Nginx and Unicorn, a lot of Ruby developers switched to Nginx for Ruby. The reasons are much the same — looking for a more scalable architecture with the application servers neatly separated from the 'concurrency/static content' layer, flexible to play around, test, change, launch, and develop further."

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.