Nginx Chs Http Events Module
时间:2009-10-04
来源:互联网
摘要 设置Nginx处理连接请求
指令 accept_mutex
Syntax: accept_mutex [ on | off ]
Default: on
nginx 使用连接互斥锁进行顺序的accept()系统调用.
accept_mutex_delay
Syntax: accept_mutex_delay Nms;
Default: 500ms
如果一个进程没有互斥锁,它将延迟至少多长时间。默认情况下,延迟是500ms 。
debug_connection
Syntax: debug_connection [ip | CIDR]
Default: none
Since 0.3.54 this option support CIDR address format
This option gives you the ability to write debug log only for the clients of this IP/NET.
Several different directives are possible.
Example:
error_log /var/log/nginx/errors;
events {
debug_connection 192.168.1.1;
}
devpoll_changes
devpoll_events
kqueue_changes
kqueue_events
epoll_events
Syntax: devpoll_changes
Default:
These directives specify how many events may be passed to/from kernel, using appropriate method.
The default devpoll values are 32, the rest are 512.
multi_accept
Syntax: multi_accept [ on | off ]
Default: off
multi_accept tries to accept() as many connections as possible after nginx gets notification about a new connection.
rtsig_signo
Syntax: rtsig_signo
Default:
nginx uses two signals when the rtsig method is used. The directive specified the first signal number. The second is plus 1.
By default rtsig_signo is SIGRTMIN+10 (40).
rtsig_overflow_events
rtsig_overflow_test
rtsig_overflow_threshold
Syntax: rtsig_overflow_*
Default:
These directives specifies how to handle rtsig queue overflows. When overflow occurred nginx flushes rtsig queue, then it handles events switching between poll() and rtsig. poll() handles consecutively all unhandled events, while rtsig periodicaly drains queue to prevent a new overflow. When overflow is handled completely, nginx switches to rtsig method again.
The rtsig_overflow_events specifies the number of events to be passed via poll(). The default is 16.
The rtsig_overflow_test specifies after which number of events handled by poll() nginx will drains rtsig queue. The default is 32.
The rtsig_overflow_threshold works in Linux 2.4.x only. Before to drain rtsig queue nginx looks in a kernel how the queue is filled up
The default is 1/10. "rtsig_overflow_threshold 3" means 1/3.
use
Syntax: use [ kqueue | rtsig | epoll | /dev/poll | select | poll | eventport ]
Default:
如果在./configure的时候指定了不止一种事件模型,那么可以设置其中一个,以便告诉nginx使用哪种事件模型。默认情况下nginx会在./configure时找出最适合系统的事件模型。
你可以在 这里 查看可用的事件模型以及如何在./configure时激活
worker_connections
Syntax: worker_connections number
Default:
通过worker_connections和worker_proceses可以计算出maxclients:
max_clients = worker_processes * worker_connections
作为反向代理,max_clients为:
max_clients = worker_processes * worker_connections/4
Since a browser opens 2 connections by default to a server and nginx uses the fds (file descriptors) from the same pool to connect to the upstream backend
指令 accept_mutex
Syntax: accept_mutex [ on | off ]
Default: on
nginx 使用连接互斥锁进行顺序的accept()系统调用.
accept_mutex_delay
Syntax: accept_mutex_delay Nms;
Default: 500ms
如果一个进程没有互斥锁,它将延迟至少多长时间。默认情况下,延迟是500ms 。
debug_connection
Syntax: debug_connection [ip | CIDR]
Default: none
Since 0.3.54 this option support CIDR address format
This option gives you the ability to write debug log only for the clients of this IP/NET.
Several different directives are possible.
Example:
error_log /var/log/nginx/errors;
events {
debug_connection 192.168.1.1;
}
devpoll_changes
devpoll_events
kqueue_changes
kqueue_events
epoll_events
Syntax: devpoll_changes
Default:
These directives specify how many events may be passed to/from kernel, using appropriate method.
The default devpoll values are 32, the rest are 512.
multi_accept
Syntax: multi_accept [ on | off ]
Default: off
multi_accept tries to accept() as many connections as possible after nginx gets notification about a new connection.
rtsig_signo
Syntax: rtsig_signo
Default:
nginx uses two signals when the rtsig method is used. The directive specified the first signal number. The second is plus 1.
By default rtsig_signo is SIGRTMIN+10 (40).
rtsig_overflow_events
rtsig_overflow_test
rtsig_overflow_threshold
Syntax: rtsig_overflow_*
Default:
These directives specifies how to handle rtsig queue overflows. When overflow occurred nginx flushes rtsig queue, then it handles events switching between poll() and rtsig. poll() handles consecutively all unhandled events, while rtsig periodicaly drains queue to prevent a new overflow. When overflow is handled completely, nginx switches to rtsig method again.
The rtsig_overflow_events specifies the number of events to be passed via poll(). The default is 16.
The rtsig_overflow_test specifies after which number of events handled by poll() nginx will drains rtsig queue. The default is 32.
The rtsig_overflow_threshold works in Linux 2.4.x only. Before to drain rtsig queue nginx looks in a kernel how the queue is filled up
The default is 1/10. "rtsig_overflow_threshold 3" means 1/3.
use
Syntax: use [ kqueue | rtsig | epoll | /dev/poll | select | poll | eventport ]
Default:
如果在./configure的时候指定了不止一种事件模型,那么可以设置其中一个,以便告诉nginx使用哪种事件模型。默认情况下nginx会在./configure时找出最适合系统的事件模型。
你可以在 这里 查看可用的事件模型以及如何在./configure时激活
worker_connections
Syntax: worker_connections number
Default:
通过worker_connections和worker_proceses可以计算出maxclients:
max_clients = worker_processes * worker_connections
作为反向代理,max_clients为:
max_clients = worker_processes * worker_connections/4
Since a browser opens 2 connections by default to a server and nginx uses the fds (file descriptors) from the same pool to connect to the upstream backend
作者: tanghaiwei 发布时间: 2009-10-04
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28