]> git.kaiwu.me - nginx.git/commit
Core: idle connections now closed only once on exiting.
authorValentin Bartenev <vbart@nginx.com>
Tue, 11 Aug 2015 13:28:55 +0000 (16:28 +0300)
committerValentin Bartenev <vbart@nginx.com>
Tue, 11 Aug 2015 13:28:55 +0000 (16:28 +0300)
commit50ff8b3c3a3eba0984ce55c63ab8ac07dcb65265
treee0dabf7a35438fe72eb650c259f90044289e7085
parent9500e19919b5410b8bc17dbd3d705eef8cf5b1d8
Core: idle connections now closed only once on exiting.

Iterating through all connections takes a lot of CPU time, especially
with large number of worker connections configured.  As a result
nginx processes used to consume CPU time during graceful shutdown.
To mitigate this we now only do a full scan for idle connections when
shutdown signal is received.

Transitions of connections to idle ones are now expected to be
avoided if the ngx_exiting flag is set.  The upstream keepalive module
was modified to follow this.
src/core/ngx_connection.c
src/core/ngx_connection.h
src/http/modules/ngx_http_upstream_keepalive_module.c
src/os/unix/ngx_process_cycle.c
src/os/win32/ngx_process_cycle.c