nginx事件模型

nginx支持多种连接处理方法。 特定方法的可用性取决于所使用的平台。 在支持多种方法的平台上,nginx通常会自动选择最高效的方法。 但是,如果需要,可以使用use指令明确选择连接处理方法。

引用原文

The following connection processing methods are supported:

select — standard method. The supporting module is built automatically on platforms that lack more efficient methods. The –with-select_module and –without-select_module configuration parameters can be used to forcibly enable or disable the build of this module.

poll — standard method. The supporting module is built automatically on platforms that lack more efficient methods. The –with-poll_module and –without-poll_module configuration parameters can be used to forcibly enable or disable the build of this module.

kqueue — efficient method used on FreeBSD 4.1+, OpenBSD 2.9+, NetBSD 2.0, and macOS.

epoll — efficient method used on Linux 2.6+.
The EPOLLRDHUP (Linux 2.6.17, glibc 2.8) and EPOLLEXCLUSIVE (Linux 4.5, glibc 2.24) flags are supported since 1.11.3.
Some older distributions like SuSE 8.2 provide patches that add epoll support to 2.4 kernels.

/dev/poll — efficient method used on Solaris 7 11/99+, HP/UX 11.22+ (eventport), IRIX 6.5.15+, and Tru64 UNIX 5.1A+.

eventport — event ports, method used on Solaris 10+ (due to known issues, it is recommended using the /dev/poll method instead).

参考文章

http://www.nginx.cn/doc/general/optimizations.htmlhttp://nginx.org/en/docs/events.html关于几种常用方法的区别https://www.cnblogs.com/creazylinux/p/7364685.html

Previous Post

nginx支持的信号指令

Next Post

nginx哈希值

Related Posts