Connection processing methods连接处理方法
nginx supports a variety of connection processing methods. nginx支持多种连接处理方法。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. 在支持多种方法的平台上,nginx通常会自动选择最有效的方法。However, if needed, a connection processing method can be selected explicitly with the use directive.但是,如果需要,可以使用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.--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.--with-poll_module
和--without-poll_module
配置参数可用于强制启用或禁用此模块的生成。 -
kqueue
—efficient method used on FreeBSD 4.1+, OpenBSD 2.9+, NetBSD 2.0, and macOS.在FreeBSD 4.1+、OpenBSD 2.9+、NetBSD 2.0和macOS上使用的有效方法。 -
epoll
—efficient method used on Linux 2.6+.在Linux2.6+上使用的有效方法。The
EPOLLRDHUP
(Linux 2.6.17, glibc 2.8) andEPOLLEXCLUSIVE
(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.一些较旧的发行版(如SuSE8.2)提供了补丁,将epoll支持添加到2.4内核中。 -
/dev/poll
—efficient method used on Solaris 7 11/99+, HP/UX 11.22+ (eventport), IRIX 6.5.15+, and Tru64 UNIX 5.1A+.在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事件端口,Solaris 10+上使用的方法(由于已知问题,建议改用/dev/poll
method instead)./dev/poll
方法)。