Nginx vs. Apache - Which Web server Is Right for Your Project?

Posted: 01/02/2013
By: Lee C.

Apache, initially released in 1995, is arguably the most established web server today and powers more sites on the web than any other server. It has been the most popular web server on the Internet since April of 1996.  However, there’s a relatively new kid on the block—Nginx—that’s been getting a lot of buzz.

When you compare Nginx vs. Apache, both are open source software, and both camps have a community of vocal advocates. Our industry leading experts in cloud and managed hosting services take a closer look and compare some of the characteristics of each to see whether you and your business are for Team Apache or Team Nginx.

Apache: Tried and True

Apache is an established, flexible web server that many enterprise-level customers rely on for delivering both dynamic and static content. Apache can run on a range of operating systems, is well-maintained, and its ubiquity means that a substantial amount of user-generated documentation exists.

One benefit of Apache is its ability to be easily customized—it has a rich set of features and can be modified and extended through the use of readily available add-on modules to fit many different technical or business needs.

However, because of the primarily process-based processing model Apache uses, it consumes more memory under high server loads, which can result in degraded performance (although the recent Apache 2.4 release promises improvements in speed and caching). Worker MPM has been available since 2004, which is thread based rather than process based. Due to how robust it is, also comes size, which leads to more memory consumption.

Nginx: Light and Lean

Cloud Configuration ToolNginx is a newer rival designed to be simple and lightweight, and to require fewer hardware resources than other web servers. It does this in part by using an event-based processing model, which generally requires less memory than a process-based server uses.

Because of this design, Nginx is fast at serving static web pages. If a website is receiving large amounts of concurrent hits that are seeking static pages, Nginx’s design has an advantage at keeping up without overly taxing server hardware.

However, because Nginx is newer, there is less documentation and support for it compared to more established web servers. The lightweight design also means that it can be more difficult to customize, which might be necessary for large or complex configurations.


Running In Tandem?

One thing to keep in mind when comparing Nginx vs. Apache is that it doesn’t have to be an either/or decision. For example, you could use Nginx in front of Apache as a reverse proxy for serving static content, for SSL termination, or in other combinations and configurations depending on your requirements to maximize the benefits of both options.

Final Score

In the end, both Nginx and Apache web servers are solid solutions although each has their fortes in given situations. Nginx’s main strengths include serving up static web pages quickly, and light consumption of memory and hardware resources. Apache is the established and versatile workhorse, with abundant module availability and documentation. Depending on your business needs and technical requirements, one or the other, or even a combination of the two, may be right for you.


Filed under: Apache, Nginx, web servers
comments powered by Disqus