Nginx, IMO

Of course it's just my opinion. I'm here to make it yours.

The general purpose web server

I’ve heard it said before that Apache is a “general purpose web server” and Nginx is for “specialized applications”.  This meme was repeated recently by Jim Jagielski, president of the Apache Software Foundation.

I believe the idea that Apache is “general purpose” and Nginx is “specialized” boils down to the following idea: Apache has hundreds of modules that enable additional functionality, whereas Nginx focuses on the core functionality of the web.  The definition of general purpose is “designed for or suitable to more than one use; broadly useful”.  It seems that Apache fits this bill quite well. But what about labeling Nginx as ”specialized”?  The definition of  specialized is “concentrating on a small area of a subject”.  I think this is where I have to disagree.  Nginx is an HTTP server.  It does not cover “a small area” of the HTTP protocol, nor does it somehow fail to provide all the features an HTTP server is expected to.  In fact, it provides quite a few features that lie outside that scope (AJP, uWSGI, etc).

To me, “general purpose” means the opposite of “specialized”.  Is Apache’s mod_svn general purpose, or is it specialized?  Obviously, it’s specialized.  Even mod_php is specialized, since it is a feature to enable a single programming language.  In the domain of an HTTP server, general purpose features would be things like serving static files, HTTP proxying, FastCGI support, etc.  So Apache’s multitude of modules don’t necessarily make it general purpose, they make it easy to specialize Apache in various ways.

Apache certainly contains a general purpose web server, but that server is functionally equivalent to Nginx. If this were the end of the story, then Apache would seem to be the clear winner, since it also provides the ability to specialize in a hundred different ways via modules.  Unfortunately, the general purpose web server that Apache contains is far less efficient than the one Nginx provides.  So this brings us to the question: if you need a general purpose web server, and don’t need to specialize, which is preferable?  A server that makes highly efficient use of resources, or one that doesn’t?  Is a HTTP server that focuses on specialization at the expense of core HTTP performance truly “general purpose”? Is a knife that features a spatula and a corkscrew, but has an inferior blade more “general purpose” than a traditional knife with a fully functional blade, or is it “specialized”?

If I need to host a Subversion repository, Apache would seem to be the best answer.  If I need to host a website, I cannot think of a single reason why I would choose Apache over Nginx.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Information

This entry was posted on 2012/03/27 by and tagged , .

Pages

Categories

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: