EventsModuleJa

インストール | モジュール |  アドオン |  設定 |  コミュニティ |  その他の情報源 = 概要 = Nginx のコネクション制御を制御します.

= ディレクティブ =

accept_mutex


nginx は、acceptシステムコールをシリアライズ化するために Mutex を用います.

有効な場合、複数のワーカプロセスが新規コネクションを accept する処理がシリアライズされます. 無効な場合、すべてのワーカプロセスが新規コネクションをオープンします. そのため、コネクションごとの流量が少ない場合、ワーカプロセスによってはシステムリソースの浪費につながります.

accept_mutex_delay


ワーカプロセスが Mutex を保持していない場合に、再度取得を試みるまで待機する時間. デフォルトでは 500ms.

debug_connection


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; }

epoll_events
Syntax: devpoll_changes

Default:  

These directives specify how many events may be passed to/from kernel, using appropriate method.

The default  values are 32, the rest are 512.

multi_accept
Syntax: multi_accept [ on | off ] 

Default: off

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  method is used. The directive specified the first signal number. The second is plus 1.

By default  is SIGRTMIN+10 (40).

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:  

If you have more than one event-model specified at the  script, then you can tell nginx which one do you want to use. By default nginx looks for the most suitable method for your OS at  time.

You can see the available event-models and how you can activate it at the   state  here

worker_connections
Syntax: worker_connections number

Default:  

The worker_connections and worker_processes from the main section allows you to calculate max clients you can handle:

max clients = worker_processes * worker_connections

In a reverse proxy situation, max clients becomes

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

= References =