Home > Article > Operation and Maintenance > Apache nginx advantages and disadvantages
Apache nginx advantages and disadvantages
1. The advantages of apache over nginx:
rewrite, more powerful than nginx's rewrite
Dynamic pages, nginx is useless for handling dynamic requests. Generally, dynamic requests have to be done by apache, and nginx is only suitable for static and reverse.
There are so many modules, you can basically find everything you can think of
Fewer bugs, nginx has relatively more bugs
2. Advantages of nginx over apache:
Lightweight, it also serves as a web service, takes up less memory and resources than apache, supports more concurrent connections, and reflects higher efficiency. This makes Nginx especially popular among virtual host providers. Welcome. In the case of high connection concurrency, Nginx is a good alternative to the Apache server: Nginx is one of the software platforms often chosen by virtual host business owners in the United States. It can support responses of up to 50,000 concurrent connections, thanks to Nginx chose epoll and kqueue as the development model for us.
Anti-concurrency, nginx processes requests asynchronously and non-blocking, while apache is blocking. Under high concurrency, nginx can maintain low resources, low consumption and high Performance
Highly modular design, writing modules is relatively simple
The community is active, and various high-performance modules are produced quickly
Nginx itself is a reverse proxy server
Outstanding load balancing capabilities, Nginx can not only directly support Rails and PHP programs to serve externally internally, but also support external services as an HTTP proxy server. Nginx is written in C, both in terms of system resource overhead and CPU usage efficiency. Much better than Perlbal.
3. Core difference
apache is a synchronous multi-process model, one connection corresponds to one process; nginx is asynchronous, multiple connections (ten thousand Level) can correspond to a process
4. Comparison of the advantages and disadvantages of the two
Nginx has simple configuration, Apache is complex;
Nginx has better static processing performance than Apache More than 3 times higher;
Apache’s support for PHP is relatively simple, and Nginx needs to be used with other backends;
Apache has more components than Nginx;
apache is a synchronous multi-process Model, one connection corresponds to one process;
nginx is asynchronous, multiple connections (10,000 levels) can correspond to one process;
nginx handles static files well and consumes less memory;
Dynamic requests are made by apache, nginx is only suitable for static and reverse;
Nginx is suitable for front-end servers, with good load performance;
Nginx itself is a reverse proxy server. And supports load balancing.
5. Summary
Nginx advantages: load balancing, reverse proxy, and static file processing advantages. nginx processes static requests faster than apache;
Apache advantages: powerful rewrite and strong dynamic request capabilities.
For more Apache related knowledge, please visit the Apache usage tutorial column!
The above is the detailed content of Apache nginx advantages and disadvantages. For more information, please follow other related articles on the PHP Chinese website!