Nginx - Events Module
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的更多相关文章
- 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 ...
- nginx上传模块—nginx upload module-
一. nginx upload module原理 官方文档: http://www.grid.net.ru/nginx/upload.en.html Nginx upload module通过ngin ...
- nginx upload module的使用
现在的网站,总会有一点与用户交互的功能,例如允许用户上传头像,上传照片,上传附件这类的.PHP写的程序,对于上传文件效率不是很高.幸好,nginx有一个名为upload的module可以解决这个问题. ...
- Nginx - SSI Module
SSI, for Server Side Includes, is actually a sort of server-side programming language interpreted by ...
- Nginx Upload Module 上传模块
传统站点在处理文件上传请求时,普遍使用后端编程语言处理,如:Java.PHP.Python.Ruby等.今天给大家介绍Nginx的一个模块,Upload Module上传模块,此模块的原理是先把用户上 ...
- Nginx Image Module图片缩略图 水印处理模块
Nginx Image Module图片缩略图 水印处理模块 下载Tengine tar -zxvf tengine-1.4.5.tar.gz cd tengine-1.4.5 下载Nginx tar ...
- 转:使用 Nginx Upload Module 实现上传文件功能
普通网站在实现文件上传功能的时候,一般是使用Python,Java等后端程序实现,比较麻烦.Nginx有一个Upload模块,可以非常简单的实现文件上传功能.此模块的原理是先把用户上传的文件保存到临时 ...
- [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 ...
- [转帖]Nginx Image Module图片缩略图 水印处理模块
Nginx Image Module图片缩略图 水印处理模块 https://www.cnblogs.com/jicki/p/5546972.html Nginx Image Module图片缩略图 ...
随机推荐
- 【Java】JDBC编程套路
转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/5847020.html 学习Java开发,一个必须掌握的知识点,就是数据库操作.当程序需要用到的数据达到一定程度 ...
- C#全角半角转换函数
Code#region 全角半角转换 /// <summary> /// 转全角的函数(SBC case) /// </summary> /// <param name= ...
- Web.config之连接字介绍
一.连接字配置方式 web.config中有两种方式来配置连接字:<appsetting>中配置,<connectionStrings>中配置. 1.<appsettin ...
- php 建立类POST/GET 的HTTP请求
1.第一种利用fsock的方式来建立类POST的请求. <?php $srv_ip = '192.168.1.5';//你的目标服务地址. $srv_port = 80;//端口 $url = ...
- java虚拟机JVM学习笔记-基础知识
最近使用开发的过程中出现了一个小问题,顺便记录一下原因和方法--java虚拟机 媒介:JVM是每一位从事Java开发工程师必须翻越的一座大山! JVM(Java Virtual Machine)JRE ...
- 跨平台实现wchar_t转成char
位宽.其实知道了这个以后,要在wchar_t 和 char两种类型之间转换就不难实现了. wchar_t 转换为char 的代码如下: 有如下的wchar_t和char变量 wchar_t w_cn ...
- TV
https://github.com/Xs4allWebTV/androidhttps://github.com/mode89/video-feedhttp://www.javaapk.com/sou ...
- git 提交远程
一.从远程克隆项目,修改后提交 1.先切换要放项目的本地目录 C:\Users\chendd>cd E:\web C:\Users\chendd>e: 2.根据服务器的git地址克隆到本地 ...
- mysql 5.7.12 新增 X plugin 详解
https://dev.mysql.com/doc/refman/5.7/en/document-store.html 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息 ...
- Keeplived 详解
http://www.cnblogs.com/pricks/p/3822232.html