Mercurial > hg > nginx
diff src/http/modules/ngx_http_upstream_ip_hash_module.c @ 6099:6ff0ebd6fbf4
Upstream: track the number of active connections to upstreams.
This also simplifies the implementation of the least_conn module.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Fri, 10 Apr 2015 13:16:23 +0300 |
parents | a2bf26774cd3 |
children | c44459611d91 |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_upstream_ip_hash_module.c Thu Apr 16 15:05:40 2015 +0300 +++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c Fri Apr 10 13:16:23 2015 +0300 @@ -242,6 +242,8 @@ pc->socklen = peer->socklen; pc->name = &peer->name; + peer->conns++; + if (now - peer->checked > peer->fail_timeout) { peer->checked = now; }