1, The advantages of Nginx with respect 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 with respect to 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
apache bar. The latter's various functional modules are implemented more than the former, such as ssl module is better than the former , there are many configurable items. One thing to note here is that epoll (FreeBSD kqueue) network io model is The underlying rationale for high performance, but not all cases are epoll A resounding victory, Brother Lian Education(www.lampbrother.net) Tip: If there are only a few files available for the static service itself,Apache 's select model may be more than epoll Higher performance. Of course, this is just a hypothesis based on the principle of the network IO model, and the actual application still needs to be measured.
2, asWebserver: Compared toApache,NginxThe use of fewer resources, support for more concurrent connections, and higher efficiency, this makesNginxis especially popular with web hosting providers. In the case of high connection concurrency,Nginxis aApachea good substitute for the server: Nginxin the United States is one of the most frequently chosen software platforms for the owners of virtual hosting businesses .. capable of supporting up to50,000the response of a number of concurrent connections, ThanksNginxfor us to choose theEpoll and Kqueueas a development model.
Nginxas a load balancer server: Nginxcan be directly supported in-houseRailsand thePHPProcedures for external service, can also support asHTTPProxy Server for external service. NginxAdoptCto write, whether it is system resource overhead orCPUuse efficiency is better thanPerlbalmuch better ..
as a mail proxy : Nginx is also a very good mail proxy server (one of the first to develop this product is also as a mail proxy server), last.fm Describes the success and the wonderful use of experience .
Nginx is a very simple installation , the configuration file is very concise (also can support perl Syntax), Bugs very few servers : Nginx Start is particularly easy , and can be run almost uninterrupted, even if running for several months does not require a reboot . You can also upgrade the software version without interruption of service .
3,Nginx Configuration Concise , Apache complex
Nginx static processing performance 3 times higher than Apache
Apache support for PHP is relatively simple,Nginx needs to cooperate with other backend
Apache has more components than Nginx
now Nginx is the preferred Web server
4, the most important difference is that Apache is a synchronous multi-process model, a connection corresponding to a process;Nginx is asynchronous, Multiple connections (million levels) can correspond to a process
5,Nginxhandle static files well,consumes less memory.but no doubtApacheis still the current mainstream,have a lot of rich features.so it needs to be paired with.of course, if you can determineNginxis suitable for the needs,then useNginxwould be a more economical way to.
6, from the personal past use of the situation,nginx load capacity is much higher than Apache. The newest server also changed to nginx . and nginx changed configuration can - t test the configuration is not a problem,theApache restart when the configuration error, it will be very crash , change the time will be very cautious now see a lot of cluster station, front -end nginx anti-concurrency, back-end Apache cluster, with good.
7,nginx processing dynamic request is chicken, general dynamic request to Apache to do,nginx only suitable for static and reverse.
8and from my own experience,Nginxis a very good front-end service, load performance very well, in the old Ben on theNginx, withWebbenchSimulation10000A static file, please do not have any difficulty. Apache thePHPthe support of the language is very good, in additionApacheThere is a strong support network, the time for the development of the oppositeNginxLonger,Bugless butApacheThere is a lack of innate support for multi-core to download the chicken ribs, recommend the useNginxdo the front end withApache. Large Web site suggestionsNginxself-generation clustering capabilities
9,NginxBetter thanApachethe main two points:1.Nginxitself is a reverse proxy server2.NginxSupport7layer load Balancing; Other of course,Nginxmight be better thanApachesupport for higher concurrency, but depending onNetCraftthe statistics, .years4months of statistical data,Apachestill occupies62.71%, whileNginxis a7.35%, so always,Aapcheis still the first of most companies, because its mature technology and development community has also been very good performance.
10 you're right web server The need to decide your choice. In most cases nginx all better than apache php-cgi support, reverse proxy function, front end cache Span style= "font-family: ' The song Body '; , maintain connections and so on. In apache+php prefork php Span style= "font-family: ' The song Body '; > If the processing is slow or the front pressure is very high, it is easy to appear apache The number of processes has soared, thereby denying service to the phenomenon.
One,Apache more than nginx module, can be directly implemented with lua Apache is the most popular, Why ? Most people don't bother updating to nginx or learning new things .
for nginx, I like it the configuration file is very concise, regular configuration makes a lot of things easy to run high efficiency, less resources, powerful proxy, very suitable for the front-end response server
13. Apache in the processing of dynamic has advantages,Nginx concurrency is better,CPU memory consumption, if rewrite frequent, that's still Apache it .
want to study for free IT Courses ? now participate in the event to receive the Learning CD: Online registration can get an email CD-ROM Tutorial! http://www.hdb.com/party/7y2pu.html ---> Open the page has contact information, do not understand the welcome to consult Kazakhstan.
Compare the advantages and disadvantages of Apache and Nginx