comparison src/core/ngx_connection.c @ 5115:a29c574d61fa

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.
author Valentin Bartenev <vbart@nginx.com>
date Fri, 15 Mar 2013 20:00:49 +0000
parents 93713d4b99c3
children f941cf265cc5
comparison
equal deleted inserted replaced
5114:a46c1cfe7263 5115:a29c574d61fa
968 ngx_log_debug1(NGX_LOG_DEBUG_CORE, c->log, 0, 968 ngx_log_debug1(NGX_LOG_DEBUG_CORE, c->log, 0,
969 "reusable connection: %ui", reusable); 969 "reusable connection: %ui", reusable);
970 970
971 if (c->reusable) { 971 if (c->reusable) {
972 ngx_queue_remove(&c->queue); 972 ngx_queue_remove(&c->queue);
973
974 #if (NGX_STAT_STUB)
975 (void) ngx_atomic_fetch_add(ngx_stat_waiting, -1);
976 #endif
973 } 977 }
974 978
975 c->reusable = reusable; 979 c->reusable = reusable;
976 980
977 if (reusable) { 981 if (reusable) {
978 /* need cast as ngx_cycle is volatile */ 982 /* need cast as ngx_cycle is volatile */
979 983
980 ngx_queue_insert_head( 984 ngx_queue_insert_head(
981 (ngx_queue_t *) &ngx_cycle->reusable_connections_queue, &c->queue); 985 (ngx_queue_t *) &ngx_cycle->reusable_connections_queue, &c->queue);
986
987 #if (NGX_STAT_STUB)
988 (void) ngx_atomic_fetch_add(ngx_stat_waiting, 1);
989 #endif
982 } 990 }
983 } 991 }
984 992
985 993
986 static void 994 static void