In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the differences between apache and nginx, the article is very detailed, has a certain reference value, interested friends must read it!
Difference
The core difference between the two is that apache is a synchronous multi-process model, one connection corresponds to one process, while nginx is asynchronous, and multiple connections (ten thousand levels) can correspond to one process (recommended Learning: apache use)
Generally speaking, for web services that require performance, use nginx. If you do not need performance only for stability, but also consider apache, the latter's various functional modules are better than the former. For example, the module of ssl is better than the former, and there are more configurable items.
Epoll (kqueue on freebsd) network IO model is the fundamental reason for high processing performance of nginx, but not in all cases epoll wins. If only a few files provide static services, apache's select model may have higher performance than epoll.
Of course, this is only an assumption based on the principle of the network IO model, and the real application still needs to be measured.
A more general solution is that the front-end nginx is anti-concurrency and the back-end apache cluster will work better together.
Apache
Apache's rewrite is more powerful than nginx. When rewrite is frequent, use apache.
With the development of apache, there are so many modules that you can find anything you can think of.
Apache is more mature, less bug, and nginx has relatively more bug.
Apache hyperstability
It is relatively simple for apache to support PHP, and nginx needs to be used with other backends.
Apache has advantages in dealing with dynamic requests, nginx is a chicken in this respect, generally dynamic requests need to be done by apache, and nginx is suitable for static and reverse.
Apache is still the mainstream today, with rich features, mature technology and development community.
Nginx
Lightweight, written in C, the same web service will take up less memory and resources
Anti-concurrency, nginx uses epoll and kqueue as its development model, handles requests asynchronously and non-blocking, and its load capacity is much higher than that of apache, while apache is blocking. Nginx can maintain low resources, low consumption and high performance under high concurrency, while apache is prone to surge in the number of processes and denial of service when PHP processing is slow or front-end pressure is high.
Nginx is good at handling static files, and its static processing performance is more than three times higher than that of apache.
The design of nginx is highly modular, and it is relatively simple to write modules.
Nginx configuration is simple, regular configuration makes a lot of things simple, and after changing the configuration, you can use-t to test whether there is a problem with the configuration. The apache configuration is complex. When you restart, you will find that there is something wrong with the configuration, which will crash.
As a load balancing server, nginx supports 7-tier load balancing.
Nginx itself is a reverse proxy server and can be used as a very good mail proxy server.
It is very easy to start, and it can run almost continuously from 7 to 24, does not need to be restarted even if it has been running for several months, and can upgrade the software version without interruption of service.
The community is active and all kinds of high-performance modules are produced quickly.
These are all the contents of the difference between apache and nginx. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.