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. Educational Codeforces Round 3 E. Minimum spanning tree for each edge (最小生成树+树链剖分)

    题目链接:http://codeforces.com/contest/609/problem/E 给你n个点,m条边. 问枚举每条边,问你加这条边的前提下组成生成树的权值最小的树的权值和是多少. 先求 ...

  2. 不能发现 class "com.uustudio.unote.android.BaseApplication"

    12-13 15:45:46.289: E/AndroidRuntime(3474): java.lang.RuntimeException: Unable to instantiate applic ...

  3. Egret的VS环境搭配

    安装配置 首先我们需要安装VS,这里我安装的是2013的版本,然后我们需要去Egret的官网下载Egret Engine.Egret Wing及Egret VS并进行安装,同时下载Google Chr ...

  4. MsSQL的游标的综合运用

    USE [ChiefWMS]GO/****** Object: StoredProcedure [dbo].[WMS_Check] Script Date: 04/05/2016 09:51:13 * ...

  5. Science上发表的超赞聚类算法(转)

    作者(Alex Rodriguez, Alessandro Laio)提出了一种很简洁优美的聚类算法, 可以识别各种形状的类簇, 并且其超参数很容易确定. 算法思想 该算法的假设是类簇的中心由一些局部 ...

  6. java中动态代理

    一.在java中怎样实现动态代理 1.我们要有一个接口,还要有一个接口的实现类,而这个实现类呢就是我们要代理的对象 接口: package org.dynamicproxy.test; public ...

  7. Codeforces Gym 100342H Problem H. Hard Test 构造题,卡迪杰斯特拉

    Problem H. Hard TestTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/at ...

  8. quartz 2.2.1 jdbc 连接池参数配置

    /** The JDBC database driver. */指定连接驱动 public static final String DB_DRIVER = "driver"; /* ...

  9. strassen algorithm

    the explaination that is clear in my view is from wiki.

  10. linux进程后台运行的几种方法

    转载:http://hi.baidu.com/ntuxmzvdpzbnuxq/item/79131b93f606a348f0421562 我 们经常会碰到这样的问题,用 telnet/ssh 登录了远 ...