The difference between Apache and Nginx

Source: Internet
Author: User

the difference and comparison between Apache and nginx:

Apache:

Apache HTTP Server ( Apache) is an open source Web server for the Apache Software Foundation, which can be run in most computer operating systems. Because of its multi-platform and security is widely used, is one of the most popular Web server-side software, it is fast, reliable and through the simple API extension, will perl/ the interpreter, such as Python, is compiled into the server.

Apache is a process-based structure that consumes more system overhead than threads, and is less suitable for multiprocessor environments, so when an Apache Web site is scaled up , Typically, you increase the server or expand the cluster nodes instead of increasing the processor.

Nginx:

Nginx is a high-performance HTTP and reverse proxy server .

is a lightweight Web Server / Reverse proxy Server / Email ( IMAP/POP3 ) Proxy Server .

1. Comparison of advantages and disadvantages:

(1) The advantages of Nginx with respect to Apache :

* Lightweight, same Web service, consumes less memory and resources than Apache

* anti-concurrency,nginx processing request is 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

(2) The advantages of Apache with respect to nginx :

* Rewrite than nginx Rewrite powerful # # #Rewrite The main function is to implement a Uniform Resource Locator (URL) of the jump

* Many modules, the basic thought can be found

* fewer bugs,nginx bugs are relatively large

* Ultra-Stable

reasons for existence: In General, Web services that require performance, with nginx. If you do not need performance for stability, choose Apache.

2. As a Web server:

compared to Apache,nginx uses fewer resources, supports more concurrent connections, and embodies greater efficiency.

Nginx as a load balancer server:nginx can not only directly support the internal rails and PHP Program External Services, You can also support http proxy servers for external service. Nginx uses C to write, whether it is the system resource overhead or CPU efficiency is better.

As a mail proxy server: One of the first purposes of developing this product is also as a mail proxy server.

3. Simple nginx configuration, more complex Apache

Nginx static processing performance 3 times higher than Apache

4, the most important difference is: Apache is a synchronous multi-process model, a connection corresponding to a process,nginx is asynchronous, multiple connections can correspond to a process.

Nginx handles static files well, consumes less memory, and is only suitable for static and reverse. Apache in the processing of dynamic has advantages,nginx concurrency is better,CPU Memory Low, if rewrite Frequent, choose Apache best.

In General,Apache remains the top choice for most companies.


This article is from the "11944248" blog, please be sure to keep this source http://11954248.blog.51cto.com/11944248/1963817

The difference between Apache and Nginx

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.