Apache and Nginx

insert image description here

1. Advantages of nginx relative to apache:
lightweight, it also serves as a web service, and takes up less memory and resources than apache to
resist concurrency. Nginx processes requests asynchronously and non-blocking, while apache is blocking, and is in high concurrency Under nginx, it can maintain low resources, low consumption and high performance.
Highly modular design, relatively simple to write modules
. The community is active, and various high-performance modules are produced quickly.

Advantages of apache over nginx:

rewrite, more powerful than nginx's rewrite

dynamic page

There are so many modules, you can find almost everything you can think of
. Few bugs, nginx has relatively more bugs

Super stable , one process is dedicated to one request, and nginx is also accessed by multiple users in one process

Nginx as a load balancing server: Nginx can directly support Rails and PHP programs to serve externally internally, and can also support externally serving as an HTTP proxy server

3. Nginx configuration is simple, and Apache is complex.
Nginx static processing performance is more than 3 times higher than Apache.
Apache's support for PHP is relatively simple. Nginx needs to cooperate with other backends.
Apache has more components than
Nginx. Now Nginx is the first choice for web servers

4. The core difference is that apache is a synchronous multi-process model, one connection corresponds to one process; nginx is asynchronous, and multiple connections (ten thousand levels) can correspond to one process

There are two main points that Nginx is superior to Apache:

1. Nginx itself is a reverse proxy server

2. Nginx supports layer 7 load balancing; of course, Nginx may support higher concurrency than apache

12 For nginx, I like that its configuration file is very concise. Regular configuration makes many things simple. It has high operating efficiency, takes up less resources, and has powerful proxy functions. It is very suitable for front-end response servers.

13. Apache has an advantage in handling dynamics. Nginx has better concurrency and low CPU memory usage. If rewrites are frequent, it is still Apache.

Guess you like

Origin blog.csdn.net/u013400314/article/details/131706867