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


最新文章

  1. java 引用传递及基本应用
  2. Rails中的content_tag与concat用法,可以连接任意html元素
  3. iOS实现书架布局样式【一些电子书的首页】
  4. uva 11922 Permutation Transforme/splay tree
  5. 【EF Code First】CodeFirst初始配置
  6. LA 4727
  7. 测试中的几个case
  8. Agri-Net(prim算法,最小生成树问题)
  9. C#-高血压生活习惯数据模拟
  10. c++中一个类所占用的空间
  11. 小白的Python之路 day1 Python3的bytes/str之别
  12. 架设rsync服务器同步数据
  13. .NET中的StringBuilder
  14. js - 关于循环
  15. c#设计应用程序单实例运行
  16. MySQL · 特性分析 · 优化器 MRR & BKA【转】
  17. wepy
  18. hbase 性能调
  19. ZooKeeper的架构
  20. Kafka在大型应用中的 20 项最佳实践

热门文章

  1. [原]使用node-mapnik和openstreetmap数据初步搭建瓦片服务
  2. libevent的使用方法--回显服务器的简单实例
  3. union all 简单用法
  4. Enterprise Library 中加密数据库连接字符串
  5. 网络复习之TCP
  6. Cocos2d-x——pthread的使用注意事项
  7. openssl数字证书常见格式与协议介绍
  8. Codeforces Round #277 (Div. 2) A. Calculating Function 水题
  9. Cocos2d-x学习笔记(10)(CCMenu菜单)
  10. Cloudera集群中提交Spark任务出现java.lang.NoSuchMethodError: org.apache.hadoop.hbase.HTableDescriptor.addFamily错误解决