ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Difference between Apache and Nginx
    DevOps/MIddleware 2020. 5. 14. 12:24

    1. Overview

    Both Apache and Nginx are open-source high-performance web servers capable of handling diverse workloads to satisfy the needs of modern web demands. They are conceptually close to each other but are close rivals in the web server business. Apache has been the leader in the web server ecosystem for 20 years and is much more popular, however, Nginx is not without its fair share of advantages. While Apache is a thing of the past, Nginx is the future of web apps and websites.

    Apache Nginx
    Apache follows the multi-threaded approach to process client requests. Nginx uses an event-driven approach to serve client requests.
    It handles dynamic content within the web server itself. It cannot process dynamic content natively.
    It cannot process multiple requests concurrently with heavy web traffic. It can process multiple client requests concurrently and efficiently with limited hardware resources.
    Modules are dynamically loaded or unloaded making it more flexible. The modules cannot be loaded dynamically. They must be compiled within the core software itself.
    Apache is designed to be a web server. Nginx is both a web server and a proxy server.
    A single thread can only process one connection. A single thread can handle multiple connections.

    2. Description

    2.1 Apache

    The Apache HTTP Server or simply goes by “Apache”, is open-source high-performance web server software developed and maintained by a consortium of developers under the sponsorship of the Apache Software Foundation. It is a collaborative webserver project designed to create a robust, secure, and efficient commercial-grade web server in compliance with the current HTTP standards. It’s a joint project managed by an open community of volunteers located across the globe to develop the HTTP web server and its accompanying documentation using the internet. Apache has been the prominent leader in the web server market since it's debuted in 1995. It hit the 100-million websites mark in 2009.

    Apache remains the first choice among the server administrators because of its power compatibility and multi-platform support. Although Apache runs efficiently on almost every major operating system including Windows, Linux, UNIX, OSX, and NetWare, it’s commonly used in combination with Linux. Its architectural simplicity and flexibility made it a popular choice among administrators because there was a certain thirst in the early communities to innovate and experiment with new technologies, and Apache was right at the center of it. Apache became of the backbone of the World Wide Web. But that’s that. As the old saying goes, when you’re at the top the only way is down.

    2.2 Nginx

    They say one’s loss in another’s gain. This is exactly what happened. Apache’s mighty status has been hit by its potential rival, Nginx. One of the first among the early contenders to receive worldwide recognition, Nginx is also a solid web server platform designed to serve modern web demands. Developed by Russian developer Igor Sysoev, Nginx is a free, open-source HTTP server that can also be used as a reverse proxy, mail proxy, and a generic TCP/UDP proxy server. It’s focused on serving a large number of concurrent users efficiently and with minimal resources. At the time when handling massive web traffic was quite impossible, Nginx came to the rescue.

    Though Nginx cannot compete against the feature-rich Apache on many fronts, its asynchronous status and single-threaded architecture make it a smart choice over Apache. It’s often preferred by administrators for its resource efficiency, lightweight architecture, and high concurrency. And the best part, it can be deployed as a standalone HTTP server to improve the web server’s architecture using minimal resources. Plus its ability to serve static traffic quickly and efficiently with limited hardware resources is unparalleled. Additionally, Nginx can also be a potential shock absorber, which would protect Apache servers from sudden traffic spikes and security vulnerabilities. In short, Nginx provides all the basic HTTP server features without sacrificing its ability to handle multiple requests with limited hardware resources.

    2.3 Difference between Apache and Nginx

    • While both Apache and Nginx are the two major players in the web server business spanning 50 percent of the web traffic over the internet, they are different from each other. Apache is an open-source HTTP server whereas Nginx is a high-performance asynchronous web server and reverse proxy server.
    • Support, bug fixes, and application development in Apache HTTP server is managed and maintained by a community of users from around the world and coordinated by the Apache Software Foundation. Support and maintenance of Nginx are handled by a company of the same name which was founded in 2011.
    • The major difference between the two is the way both handle client requests. While Apache provides a variety of multiprocessing modules to handle client requests and web traffic, Nginx is so designed to handle multiple client requests simultaneously with minimal hardware resources.
    • In the Apache HTTP server, a single thread is associated with only one connection, whereas a single thread in Nginx can handle multiple connections. All the processes are put in an event loop along with other connections and are managed asynchronously. This process consumes less memory thereby increasing performance.
    • Apache has a multi-threaded architecture that lacks scalability. Nginx, on the other hand, follows an asynchronous event-driven approach to handle multiple client requests. Its event-driven architecture is so designed to facilitate better performance even under heavy traffic.
    • Apache serves static content using conventional methods and processes dynamic content natively within the web server itself. Nginx, on the other hand, lacks the ability to process dynamic content internally. In fact, it relies on external processes for execution.

    3. Reference

    velog.io/@jiselectric/Apache-NginX

    piyushchaudhariblog.wordpress.com/2017/04/26/nginx-versus-apache/

    http://www.differencebetween.net/technology/difference-between-apache-and-nginx/

    https://www.nginx.com

    https://httpd.apache.org/

    'DevOps > MIddleware' 카테고리의 다른 글

    HAProxy  (0) 2020.05.03

    댓글

Designed by Tistory.