FAQ

Page Discussion Edit History

ChsHttpEventsModule

(Redirected from NginxChsHttpEventsModule)

Add By Chancey

Contents

[edit] 鎽樿

璁剧疆Nginx澶勭悊杩炴帴璇锋眰

[edit] 鎸囦护

[edit] accept_mutex

Syntax: accept_mutex [ on | off ]

Default: on

nginx 浣跨敤杩炴帴浜掓枼閿佽繘琛岄『搴忕殑accept()绯荤粺璋冪敤.

[edit] accept_mutex_delay

Syntax: accept_mutex_delay Nms;

Default: 500ms

濡傛灉涓涓繘绋嬫病鏈変簰鏂ラ攣锛屽畠灏嗗欢杩熻嚦灏戝闀挎椂闂淬傞粯璁ゆ儏鍐典笅锛屽欢杩熸槸500ms 銆


[edit] 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;
}

[edit] devpoll_changes

[edit] devpoll_events

[edit] kqueue_changes

[edit] kqueue_events

[edit] 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.

[edit] 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.



[edit] 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).


[edit] rtsig_overflow_events

[edit] rtsig_overflow_test

[edit] 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.

[edit] use

Syntax: use [ kqueue | rtsig | epoll | /dev/poll | select | poll | eventport ]

Default:


濡傛灉鍦./configure鐨勬椂鍊欐寚瀹氫簡涓嶆涓绉嶄簨浠舵ā鍨嬶紝閭d箞鍙互璁剧疆鍏朵腑涓涓紝浠ヤ究鍛婅瘔nginx浣跨敤鍝浜嬩欢妯″瀷銆傞粯璁ゆ儏鍐典笅nginx浼氬湪./configure鏃舵壘鍑烘渶閫傚悎绯荤粺鐨勪簨浠舵ā鍨嬨

浣犲彲浠ュ湪 杩欓噷 鏌ョ湅鍙敤鐨勪簨浠舵ā鍨嬩互鍙婂浣曞湪./configure鏃舵縺娲

[edit] worker_connections

Syntax: worker_connections number

Default:

閫氳繃worker_connections鍜寃orker_proceses鍙互璁$畻鍑簃axclients锛

max_clients = worker_processes * worker_connections

浣滀负鍙嶅悜浠g悊锛宮ax_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

[edit] References