From bac0cb3bbd507400c9dbac03eacbb6c6937efccd Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Fri, 15 Mar 2013 20:00:49 +0000 Subject: Status: introduced the "ngx_stat_waiting" counter. And corresponding variable $connections_waiting was added. Previously, waiting connections were counted as the difference between active connections and the sum of reading and writing connections. That made it impossible to count more than one request in one connection as reading or writing (as is the case for SPDY). Also, we no longer count connections in handshake state as waiting. --- src/core/ngx_connection.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core') diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c index 09ad15fcc..60f4d5145 100644 --- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -970,6 +970,10 @@ ngx_reusable_connection(ngx_connection_t *c, ngx_uint_t reusable) if (c->reusable) { ngx_queue_remove(&c->queue); + +#if (NGX_STAT_STUB) + (void) ngx_atomic_fetch_add(ngx_stat_waiting, -1); +#endif } c->reusable = reusable; @@ -979,6 +983,10 @@ ngx_reusable_connection(ngx_connection_t *c, ngx_uint_t reusable) ngx_queue_insert_head( (ngx_queue_t *) &ngx_cycle->reusable_connections_queue, &c->queue); + +#if (NGX_STAT_STUB) + (void) ngx_atomic_fetch_add(ngx_stat_waiting, 1); +#endif } } -- cgit