The pros and cons of Nginx and Apache

Source: Internet
Author: User
Tags hosting

The advantages of Nginx relative to Apache:

    • Lightweight, same Web service, consumes less memory and resources than Apache
    • Anti-concurrency, Nginx processing requests are asynchronous non-blocking, and Apache is blocking type, in high concurrency, nginx can keep low resource consumption and high performance
    • Highly modular design, relatively simple to write modules
    • Community active, a variety of high-performance modules produced quickly AH

The advantages of Apache relative Nginx:

    • Rewrite, stronger than Nginx's rewrite
    • The module is too much, the basic thought can be found
    • Fewer bugs, nginx bugs are relatively large
    • Ultra-Stable

Advantages and Disadvantages

1, as a WEB server: using less resources than Apache,nginx, supporting more concurrent connections, reflecting higher efficiency, which makes Nginx particularly popular with virtual hosting providers. In the case of high connection concurrency, Nginx is a good alternative to Apache server: Nginx in the United States is a virtual hosting business owners often choose one of the software platform. Capable of supporting up to 50,000 concurrent connections, thanks to Nginx for choosing Epoll and Kqueue as the development model.
Nginx as a Load Balancer server: Nginx can either directly support the internal Rails and PHP programs outside the service, also can support as an HTTP proxy server external services. Nginx is written in C, which is much better than Perlbal, both in terms of system resource overhead and CPU efficiency.
2, Nginx configuration is concise, Apache complex, Nginx Start is particularly easy, and almost can do uninterrupted operation, even if the operation for several months do not need to restart. You will also be able to upgrade the software version without interruption of service. Nginx Static processing performance is 3 times times higher than Apache, Apache support for PHP is relatively simple, nginx need to cooperate with other backend to use, Apache more than Nginx components.
3, the most important difference is that Apache is a synchronous multi-process model, a connection corresponding to a process; Nginx is asynchronous, and multiple connections (million levels) can correspond to a process.
4, Nginx's advantage is to handle static requests, CPU memory usage is low, Apache suitable for processing dynamic requests, so now the general front-end with Nginx as the reverse proxy anti-pressure, Apache as the back-end processing of dynamic requests.

The pros and cons of Nginx and Apache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.