📅  最后修改于: 2021-01-07 05:55:58             🧑  作者: Mango
Apache和NGINX是Web服务器业务中的两个主要参与者,它们占Internet上Web流量的5%,但它们彼此不同。
Apache是“ Apache HTTP服务器”。它是由Apache Software Foundation开发和维护的开源,高性能Web服务器软件。 Apache旨在创建符合当前HTTP标准的安全,健壮和高效的商业级Web服务器。
由于Apache的灵活性,体系结构简单性,电源兼容性和多平台支持,因此仍然是服务器管理员中的首选。它几乎可以在所有操作系统上运行,例如Windows,UNIX,OSX,NetWare等。但是,它通常与Linux结合使用。
Apache成为了WWW(万维网)的骨干,它确实处于游戏的顶端,但是当NGINX投入业务时,服务器管理员的选择就改变了。
是的,我们可以说NGINX在许多方面都无法与功能丰富的Apache竞争,但是它的异步状态和单线程体系结构使其成为选择Apache的明智选择。
让我们看看Apache和NGINX之间的区别:
Apache | NGINX |
---|---|
Apache runs on all Unix like systems such as Linux, BSD, etc. as well as completely supports Windows. | Nginx runs on modern Unix like systems; however it has limited support for Windows. |
Apache uses a multi-threaded approach to process client requests. | Nginx follows an event-driven approach to serve client requests. |
Apache cannot handle multiple requests concurrently with heavy web traffic. | Nginx can handle multiple client requests concurrently and efficiently with limited hardware resources. |
Apache processes dynamic content within the web server itself. | Nginx can’t process dynamic content natively. |
Apache is designed to be a web server. | Nginx is both a web server and a proxy server. |
Modules are dynamically loaded or unloaded, making it more flexible. | Since modules cannot be loaded dynamically, they must be compiled within the core software itself. |
A single thread can only process one connection. | A single thread can handle multiple connections. |
The performance of Apache for static content is lower than Nginx. | Nginx can simultaneously run thousands of connections of static content two times faster than Apache and uses little less memory. |