diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2017-03-07 18:51:16 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2017-03-07 18:51:16 +0300 |
commit | 12b9974d510d38574c6cfb28ee3e87540230c56e (patch) | |
tree | cf66752182343de8606a9ac2d9625508d574356b /src/core/nginx.c | |
parent | 1a58418ae76a96c830a0536432e96a9ad051bc58 (diff) | |
download | nginx-12b9974d510d38574c6cfb28ee3e87540230c56e.tar.gz nginx-12b9974d510d38574c6cfb28ee3e87540230c56e.zip |
Introduced worker_shutdown_timeout.
The directive configures a timeout to be used when gracefully shutting down
worker processes. When the timer expires, nginx will try to close all
the connections currently open to facilitate shutdown.
Diffstat (limited to 'src/core/nginx.c')
-rw-r--r-- | src/core/nginx.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c index c5f09a553..abaa50d61 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -124,6 +124,13 @@ static ngx_command_t ngx_core_commands[] = { offsetof(ngx_core_conf_t, rlimit_core), NULL }, + { ngx_string("worker_shutdown_timeout"), + NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1, + ngx_conf_set_msec_slot, + 0, + offsetof(ngx_core_conf_t, shutdown_timeout), + NULL }, + { ngx_string("working_directory"), NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1, ngx_conf_set_str_slot, @@ -1014,6 +1021,7 @@ ngx_core_module_create_conf(ngx_cycle_t *cycle) ccf->daemon = NGX_CONF_UNSET; ccf->master = NGX_CONF_UNSET; ccf->timer_resolution = NGX_CONF_UNSET_MSEC; + ccf->shutdown_timeout = NGX_CONF_UNSET_MSEC; ccf->worker_processes = NGX_CONF_UNSET; ccf->debug_points = NGX_CONF_UNSET; @@ -1042,6 +1050,7 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf) ngx_conf_init_value(ccf->daemon, 1); ngx_conf_init_value(ccf->master, 1); ngx_conf_init_msec_value(ccf->timer_resolution, 0); + ngx_conf_init_msec_value(ccf->shutdown_timeout, 0); ngx_conf_init_value(ccf->worker_processes, 1); ngx_conf_init_value(ccf->debug_points, 0); |