Turn "nginx Advantages and disadvantages

Source: Internet
Author: User
Tags epoll

Original blog from: http://blog.csdn.net/a454211787/article/details/22494485 thanks!

1, Nginx advantages compared to Apache:
Lightweight same Web service consumes less memory and resources than Apache
Anti-concurrent Nginx processing request asynchronous non-blocking while Apache block-type high concurrent nginx can keep low resource consumption and high performance
Highly modular design programming module is relatively simple
Community active various high-performance modules produced quickly.
Apache benefits compared to Nginx:

Rewrite more powerful than Nginx rewrite
Dynamic pages
Module super Many basic want to find
Fewer bugs Nginx bugs are relatively large

Ultra-Stable

The need for performance Web services with Nginx needs performance just to stabilize Apache.
The various functional modules are implemented more than the former example SSL module than the former good configuration items to pay attention to point Epoll (FreeBSD on Kqueue) network
IO model Nginx Processing performance high fundamental reasons and in all cases Epoll victory itself provides static services with only a few texts
Apache Select model may be more performant than epoll when the hypothesis is based on the principle of the network IO model the actual application needs to be measured.


2. As a WEB server: use less resources to support more concurrent connections than Apachenginx more efficient points
Make Nginx particularly popular with virtual hosting providers Nginxapache server wrong substitute for high-connectivity concurrency: Nginx us to do virtual hosting
The boss often chooses the software platform. Capable of supporting up to 50,000 concurrent connection responses, thanks to Nginx we chose Epoll and Kqueue as the development model.
Nginx
As a Load Balancer server: Nginx directly supports both Rails and PHP programs for external service, and also supports external HTTP proxy server
Service. Nginx uses C to write, on the system resource overhead also CPU use efficiency is much better than Perlbal.
As a mail proxy: Nginx is also very good mail proxy server (also as a mail proxy server for developing products earlier), Last.fm describes the success and the wonderful use of experience.
Nginx
Installation is very simple, the configuration file is very concise (also can support Perl syntax), Bugs very few servers: Nginx boot is particularly easy, and almost do
The 7x24 run will require a reboot even if it runs for several months. The software version can also be upgraded in the event of intermittent service.

3, Nginx Configuration concise, Apache complex
Nginx static processing Performance 3 times times higher than Apache
Apache support for PHP relatively simple nginx needs to be used with its end
More Apache components than Nginx
Now Nginx only WEB server preferred

4, the core is different from the Apache synchronous multi-process model connection corresponding process; Nginx asynchronous multi-connection (million-level) corresponding process

5, Nginx processing static file is good, consumes less memory. There is no doubt that Apache is still in the mainstream and rich in features. It needs to be paired. It is more economical to use nginx when it is possible to make sure Nginx is suitable for your needs.
Apache has the innate support for multi-core processing load of chicken ribs shortcomings are recommended to use Nginx for the front end of the large web site with Apache recommended Nginx self-generation cluster function

6.
From the past use of the situation, nginx load capacity than Apache more new server also used Nginx and Nginx changed configuration can T-test configuration has
There is a problem when the Apache restarts when the configuration error will crash and then you'll be very cautious now see a lot of cluster station front end Nginx anti-concurrent Apache cluster
Match is also wrong

7, Nginx processing dynamic request Chicken-like dynamic request to Apache to do nginx only suitable for static and reverse

8, from my experience to see nginx wrong front-end server load performance good old Ben on open nginx with Webbench simulation 10000 static file request very laborious Apache support for languages such as PHP well, Apache has a strong support network development time is more than nginx longer

9.
Nginx is superior to Apache two points: 1.Nginx itself reverse proxy server 2.Nginx support 7 layer load balancing;
Apache supports higher concurrency according to netcraft statistics April 2011 Statistics Apache occupies 62.71% and Nginx
7.35% so always, aapche. Most companies have also had very bad performance in the first place because of their mature technology and development community

10, the choice of Web server needs to choose a large
In some cases nginx is superior to Apache compared to the static file processing, php-cgi support, reverse proxy function, front end cache, maintenance connection and so on.
apache+php (prefork) mode PHP processing slow or front-end pressure is very prone to the Apache process number soared so that the denial of service phenomenon

11, see the Nginx LUA module: Https://github.com/chaoslaw...apache than nginx multi-module directly with LUA to achieve Apache popular why most people do not bother to update nginx or learn new things

12, for Nginx I like the configuration file concise regular configuration to make a lot of things simple running efficiency high occupancy resources less agent powerful suitable for the front-end response server

13, Apache processing dynamic has the advantage of nginx concurrency comparison good CPU memory consumption low rewrite frequent or use Apache bar

Turn "nginx Advantages and disadvantages

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.