aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_cycle.h
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2017-01-20 14:03:20 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2017-01-20 14:03:20 +0300
commitc3ad24da01c062eaa4eb096f85f9be2312316821 (patch)
tree20c15be390173fe2638da269b29bc9c7bc449d04 /src/core/ngx_cycle.h
parent660e1a5340f15bdfcedfd298ccf96ca8a9604af2 (diff)
downloadnginx-c3ad24da01c062eaa4eb096f85f9be2312316821.tar.gz
nginx-c3ad24da01c062eaa4eb096f85f9be2312316821.zip
Improved connection draining with small number of connections.
Closing up to 32 connections might be too aggressive if worker_connections is set to a comparable number (and/or there are only a small number of reusable connections). If an occasional connection shorage happens in such a configuration, it leads to closing all reusable connections instead of gradually reducing keepalive timeout to a smaller value. To improve granularity in such configurations we now close no more than 1/8 of all reusable connections at once. Suggested by Joel Cunningham.
Diffstat (limited to 'src/core/ngx_cycle.h')
-rw-r--r--src/core/ngx_cycle.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/ngx_cycle.h b/src/core/ngx_cycle.h
index 5cdacf14c..d804eb414 100644
--- a/src/core/ngx_cycle.h
+++ b/src/core/ngx_cycle.h
@@ -53,6 +53,7 @@ struct ngx_cycle_s {
ngx_uint_t modules_used; /* unsigned modules_used:1; */
ngx_queue_t reusable_connections_queue;
+ ngx_uint_t reusable_connections_n;
ngx_array_t listening;
ngx_array_t paths;