编译自:
http://nginx.org/en/docs/events.htmlhtml
nginx 支持多种并发模型,并发模型的具体实现根据系统平台而有所不一样。
在支持多种并发模型的平台上,nginx 自动选择最高效的模型。但咱们也能够使用 use 指令
在配置文件中显式地定义某个并发模型。nginx
nginx 支持的并发模型以下:并发
select
标准并发模型。在编译 nginx 时,若是所使用的系统平台没有更高效的并发模型,select 模块
将被自动编译。configure 脚本的选项:--with-select_module 和 --without-select_module 可被用来强制性地开启或禁止 select 模块的编译
ide
poll
标准并发模型。与 select 相似,在编译 nginx 时,若是所使用的系统平台没有更高效的并发模型,poll 模块将被自动编译。configure 脚本的选项:--with-poll_module 和 --without-poll_module 可用于强制性地开启或禁止 poll 模块的编译spa
kqueue
高效并发模型
可在 FreeBSD 4.1+, OpenBSD 2.9+, NetBSD 2.0, and Mac OS X 平台中使用htm
epoll
高效并发模型
可在 Linux 2.6+ 平台中使用
Note:
Some older distributions like SuSE 8.2 provide patches that add epoll support to 2.4 kernels.get
/dev/poll
高效并发模型
可在 Solaris 7 11/99+, HP/UX 11.22+ (eventport), IRIX 6.5.15+, and Tru64 UNIX 5.1A+ 平台使用it
eventport
高效并发模型
可用于 Solaris 10 平台
io