The Events module comes with directives that allow you to configure network mechanisms. Some of the parameters have an important impact on the application's performance.

All of the directives listed in the following table must be placed in the events block, which is located at the root of the configuration file:

user nginx nginx;
master_process on;
worker_processes 4;
events {
worker_connections 1024;
use epoll;
}
[...]

These directives cannot be placed elsewhere (if you do so, the configuration test will fail).


accept_mutex

Enables or disables the use of an accept mutex (mutual exclusion) to open listening sockets.

Accepted values: on or off
Example: accept_mutex on;
Default value: on


accept_mutex_delay

Defines the amount of time a worker process should wait before trying to acquire the resource again. This value is not used if the accept_mutex directive is set to off.

Syntax: Numeric (time)
Example: accept_mutex_delay 500ms;
Default value: 500 milliseconds


connections

Replaced by worker_connections. This directive is now deprecated.


debug_connection

Writes detailed logs for clients matching this IP address or address block. The debug information is stored in the file
specified with the error_log directive, enabled with the debug level.
Note: Nginx must be compiled with the --debug switch in order to enable this feature.

Syntax: IP address or CIDR block.
Example: debug_connection 172.63.155.21;
Example: debug_connection 172.63.155.0/24;
Default value: None.


multi_accept

Defines whether or not Nginx should accept all incoming connections at once from the listening queue.

Syntax: on or off
Example: multi_accept off;
Default value: off


use

Selects the event model among the available ones (the ones that you enabled at compile time), though Nginx automatically selects the most appropriate one.
The supported models are:

  • select: The default and standard module, it is used if the OS does not support a more efficient one (it's the only available method under Windows). This method is not recommended for servers that expect to be under high load.
  • poll: It is automatically preferred over select, but is not available on all systems.
  • kqueue: An efficient method for FreeBSD 4.1+, OpenBSD 2.9+, NetBSD 2.0, and MacOS X operating systems.
  • epoll: An efficient method for Linux 2.6+ based operating systems.
  • rtsig: Real-time signals, available as of Linux 2.2.19, but unsuited for high-traffic profiles as default system settings only allow 1,024 queued signals.
  • /dev/poll: An efficient method for Solaris 7 11/99+, HP/UX 11.22+, IRIX 6.5.15+, and Tru64 UNIX 5.1A+ operating systems.
  • eventport: An efficient method for Solaris 10, though a security patch is required.

Accepted values: /dev/poll, epoll, eventport, kqueue, rtsig, or select
Example: use kqueue;
Default value: Defined at compile time


worker_connections

Defines the amount of connections that a worker process may treat simultaneously.

Syntax: Numeric
Example: worker_connections 1024;
Default value: None


Nginx - Events Module的更多相关文章

  1. How to Customize Server Header using NginX headers-more module

    http://wiki.nginx.org/HttpHeadersMoreModule#Version headers_more When you are browsing a website, yo ...

  2. nginx上传模块—nginx upload module-

    一. nginx upload module原理 官方文档: http://www.grid.net.ru/nginx/upload.en.html Nginx upload module通过ngin ...

  3. nginx upload module的使用

    现在的网站,总会有一点与用户交互的功能,例如允许用户上传头像,上传照片,上传附件这类的.PHP写的程序,对于上传文件效率不是很高.幸好,nginx有一个名为upload的module可以解决这个问题. ...

  4. Nginx - SSI Module

    SSI, for Server Side Includes, is actually a sort of server-side programming language interpreted by ...

  5. Nginx Upload Module 上传模块

    传统站点在处理文件上传请求时,普遍使用后端编程语言处理,如:Java.PHP.Python.Ruby等.今天给大家介绍Nginx的一个模块,Upload Module上传模块,此模块的原理是先把用户上 ...

  6. Nginx Image Module图片缩略图 水印处理模块

    Nginx Image Module图片缩略图 水印处理模块 下载Tengine tar -zxvf tengine-1.4.5.tar.gz cd tengine-1.4.5 下载Nginx tar ...

  7. 转:使用 Nginx Upload Module 实现上传文件功能

    普通网站在实现文件上传功能的时候,一般是使用Python,Java等后端程序实现,比较麻烦.Nginx有一个Upload模块,可以非常简单的实现文件上传功能.此模块的原理是先把用户上传的文件保存到临时 ...

  8. [root@offical nginx]# nginx -t nginx: [emerg] module "/usr/lib64/nginx/modules/ngx_http_geoip_module.so" version 1012002 instead of 1016001 in /usr/share/nginx/modules/mod-http-geoip.conf:1 nginx: con

    [root@offical nginx]# nginx -tnginx: [emerg] module "/usr/lib64/nginx/modules/ngx_http_geoip_mo ...

  9. [转帖]Nginx Image Module图片缩略图 水印处理模块

    Nginx Image Module图片缩略图 水印处理模块 https://www.cnblogs.com/jicki/p/5546972.html Nginx Image Module图片缩略图 ...

随机推荐

  1. android中的Cursor类

    转载: 使用过 SQLite 数据库的童鞋对 Cursor 应该不陌生,如果你是搞.net 开发你大可以把Cursor理解成 Ado.net 中的数据集合相当于dataReader.今天特地将它单独拿 ...

  2. 【数据库】MySql常用函数梳理

    转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/5866388.html MySql常用函数梳理: 1:数学函数 使用格式:一般用于插入.修改语句中,直接 函数( ...

  3. 第十五章 String讲解

    package ch15; import java.util.Scanner; public class Test { public static void main(String[] args) { ...

  4. STM32实验非正式报告之DMA

    前言 DMA即直接内存存取.我理解它就是一个“交通部长”抑或是一个“搬运工”,协助CPU存储或读取数据.既然它的主要工作就是“搬运”数据,服务对象自然就是内存(不太严格的说法吧,STM32中Flash ...

  5. oracle备份恢复之rman恢复到异机

    注意事项: 1 此处实验环境为同平台,同字节序,同版本,源机器和目标机器相同的目录结构. 2 目标机器只需要安装oracle数据库软件即可. 3 第一次利用备份恢复测试环境,之后从源机器拷贝备份到目标 ...

  6. PROCESS_YIELD()宏使用及过程分析<contiki学习笔记之八>

    好吧,昨晚上研究了switch()的底层实现原理--发现它并不是一般C语言教科书上那样所言,当然,这对于本身就非常熟悉汇编的同学来说,是小菜一碟.世界上,很多事情是巧合与必然的结合体,没有无缘无故的爱 ...

  7. iOS UIButton EdgeInsets

    说一下系统的button,image 和 title的位置关系 默认image 和 title的位置关系: 随便画了草图,有点丑,不过不妨碍理解: 第一种:在button上只设置文字,这个时候,but ...

  8. SAP-设置显示表格格式

    在我们用SAP系统的过程中产看表格的时候,需要设置查看表格的格式,表格的格式主要包含两个方面: 1,表格的样式 在查看表格的时候点击[设置]-[用户参数] 勾选[ALV Grid display]就控 ...

  9. C++ XML解析之TinyXML篇[转]

    最 近使用TinyXML进行C++ XML解析,感觉使用起来比较简单,很容易上手,本文给出一个使用TinyXML进行XML解析的简单例子,很多复杂的应用都可以基于本例子的方法来完 成.以后的文章里会讲 ...

  10. LeetCode: Reverse Words in a String:Evaluate Reverse Polish Notation

    LeetCode: Reverse Words in a String:Evaluate Reverse Polish Notation Evaluate the value of an arithm ...