diff options
author | Valentin Bartenev <vbart@nginx.com> | 2015-08-11 16:28:55 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2015-08-11 16:28:55 +0300 |
commit | 50ff8b3c3a3eba0984ce55c63ab8ac07dcb65265 (patch) | |
tree | e0dabf7a35438fe72eb650c259f90044289e7085 /src/core/ngx_connection.h | |
parent | 9500e19919b5410b8bc17dbd3d705eef8cf5b1d8 (diff) | |
download | nginx-50ff8b3c3a3eba0984ce55c63ab8ac07dcb65265.tar.gz nginx-50ff8b3c3a3eba0984ce55c63ab8ac07dcb65265.zip |
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.
Diffstat (limited to 'src/core/ngx_connection.h')
-rw-r--r-- | src/core/ngx_connection.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h index a49aa9579..c3aca7f47 100644 --- a/src/core/ngx_connection.h +++ b/src/core/ngx_connection.h @@ -215,6 +215,7 @@ ngx_int_t ngx_open_listening_sockets(ngx_cycle_t *cycle); void ngx_configure_listening_sockets(ngx_cycle_t *cycle); void ngx_close_listening_sockets(ngx_cycle_t *cycle); void ngx_close_connection(ngx_connection_t *c); +void ngx_close_idle_connections(ngx_cycle_t *cycle); ngx_int_t ngx_connection_local_sockaddr(ngx_connection_t *c, ngx_str_t *s, ngx_uint_t port); ngx_int_t ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text); |