Nginx vs Apache

Source: Internet
Author: User

In peacetime work has been exposed to Nginx and Apache two Web server, has not clarified the difference between the two, specifically to find some information and blog, finally is to understand the favorite noodles specially to share with you. Nginx compared to the advantages of Apache Lightweight, the same Web services, more than Apache occupy less memory and resources anti-concurrency, Nginx processing requests are asynchronous non-blocking, and Apache is blocking type, in high concurrency, nginx can keep low resource consumption high High performance modular design, writing modules relatively simple community active, a variety of high-performance modules produced quickly AH

Apache relative Nginx advantages rewrite, more than Nginx rewrite powerful modules, the basic thought can find fewer bugs, Nginx bug relatively more ultra-stable

Summarize

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.

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.