Connection processing methods
连接处理的方式
nginx supports a variety of connection processing methods. The availability of a particular method depends on the platform used. On platforms that support several methods nginx will normally select the most efficient method automatically. However, if needed, a connection processing method can be selected explicitly with the use directive.
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.select
- 标准方法。在缺乏更高效方法的平台上自动构建。配置参数--with-select_module
和--without-select_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.poll
—- 标准方法。在缺乏更高效方法的平台上自动构建。配置参数--with-poll_module
和--without-poll_module
可用于强制启用或禁用该模块的构建。 -
kqueue
— efficient method used on FreeBSD 4.1+, OpenBSD 2.9+, NetBSD 2.0, and macOS.kqueue — 在 FreeBSD 4.1+、OpenBSD 2.9+、NetBSD 2.0 和 macOS 上使用的高效方法
-
epoll
— efficient method used on Linux 2.6+.epoll
— 在 Linux 2.6 以上版本中使用的高效方法。The
EPOLLRDHUP
(Linux 2.6.17, glibc 2.8) andEPOLLEXCLUSIVE
(Linux 4.5, glibc 2.24) flags are supported since 1.11.3.从nginx 1.11.3起支持
EPOLLRDHUP
(Linux 2.6.17,glibc 2.8)和EPOLLEXCLUSIVE
(Linux 4.5,glibc 2.24)。Some older distributions like SuSE 8.2 provide patches that add epoll support to 2.4 kernels.
一些旧发行版(如SuSE 8.2)为Linux 2.4内核提供了epoll补丁。
-
/dev/poll
— efficient method used on Solaris 7 11/99+, HP/UX 11.22+ (eventport), IRIX 6.5.15+, and Tru64 UNIX 5.1A+./dev/poll
- 是在Solaris 7 11/99+、HP/UX 11.22+(eventport)、IRIX 6.5.15+ 和 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).eventport
- 事件端口(event ports),是在Solaris 10+上使用的方法(由于已知问题,建议使用/dev/poll
方法代替)。