Friday, July 11, 2014

Nginx vs Apache Architecture and Performance

1:39 PM

 Nginx and Apache ( pronounced “engine-x”) are free, open-source, cross-platform web servers.





Nginx was developed by Igor Sysoev for use with one of Russia’s largest sites: Rambler (a web portal). He started developing the software in 2002, but the first public release wasn’t until 2004. The popularity of nginx has since exploded and it’s now used by millions of sites.

The Apache HTTP Server, commonly referred to as Apache, is a web server notable for playing a key role in the initial growth of the World Wide Web. In 2009 Apache became the first web server to surpass the 100 million web site milestone. Since April 1996 Apache has been the most popular HTTP server on the World Wide Web.

Nginx Architecture



Nginx is an event-based web server.

Nginx and Lighttpd are probably the two best-known asynchronous servers.The main advantage of the asynchronous approach is scalability.An asynchronous server, on the other hand, is event-driven and handles requests in a single (or at least, very few) threads.

Pulling numbers from thin air for illustrative purposes, serving 10,000 simultaneous connections would probably only cause Nginx to use a few megabytes of RAM.

Apache Architecture

 

Apache is a process-based server

In a process-based server, each simultaneous connection requires a thread which incurs significant overhead
and often perform on par with an asynchronous server under light loads, under heavier loads they usually consume far more RAM which significantly degrades performance. Also, they degrade much faster on less powerful hardware or in a resource-restricted environment such as a VPS. 

Pulling numbers from thin air for illustrative purposes, serving 10,000 simultaneous connections would  consume hundreds of megabytes.

Features:

Like Apache, Nginx has all the features you would expect from a leading Web server


  •  Ability to handle more than 10,000 simultaneous connections with a low memory footprint (~2.5 MB per 10k inactive HTTP keep-alive connections.
  •  Static file serving.
  • SSL/TLS support.
  • Virtual hosts.
  • Reverse proxying.
  • Load balancing.
  • Compression.
  • Access controls.
  • URL rewriting.
  • Custom logging.
  • Server-side includes.
  • Limited WebDAV.
  • FLV streaming.
  • FastCGI. 
Web Server Status



What is C10K

The C10k problem is the problem of optimizing network sockets to handle a large number of clients at the same time. The name C10k is a numeronym for concurrently handling ten thousand connections.

Adavantage of Nginx Over Apache

  • Nginx is one of a handful of servers written to address the C10K problem.
  • Performance and efficiency.
  • Nginx is a fast, light-weight web server that can also be used as a load balancer and caching server.
  • Memory usage is very low.
  • Asynchronously with one thread, rather than using multi-threaded programming.
Advantage of Apache over Nginx

  • Apache comes with built in support for PHP, Python, Perl, and other languages.  
  • digest access authentication
  • CGI
  • administrative console
  • .htaccess



Written by

0 comments :

Post a Comment

 

© 2014 Linux Storages | Updated . All rights resevered. Designed by Templateism