diff options
author | Ruslan Ermilov <ru@nginx.com> | 2016-09-22 19:32:47 +0300 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2016-09-22 19:32:47 +0300 |
commit | f674f32c09c9938d5f2b19509166e5c5e28a9e3c (patch) | |
tree | 225a53166111dd4f818b83a4d603aab4d187e52e /src/http/modules/ngx_http_upstream_ip_hash_module.c | |
parent | fd9e74f656b3a7683424304da3bc859988407acf (diff) | |
download | nginx-f674f32c09c9938d5f2b19509166e5c5e28a9e3c.tar.gz nginx-f674f32c09c9938d5f2b19509166e5c5e28a9e3c.zip |
Upstream: max_conns.
Diffstat (limited to 'src/http/modules/ngx_http_upstream_ip_hash_module.c')
-rw-r--r-- | src/http/modules/ngx_http_upstream_ip_hash_module.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_upstream_ip_hash_module.c b/src/http/modules/ngx_http_upstream_ip_hash_module.c index 8a5f0fa3a..296108fdb 100644 --- a/src/http/modules/ngx_http_upstream_ip_hash_module.c +++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c @@ -212,6 +212,10 @@ ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data) goto next; } + if (peer->max_conns && peer->conns >= peer->max_conns) { + goto next; + } + break; next: @@ -259,6 +263,7 @@ ngx_http_upstream_ip_hash(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) uscf->flags = NGX_HTTP_UPSTREAM_CREATE |NGX_HTTP_UPSTREAM_WEIGHT + |NGX_HTTP_UPSTREAM_MAX_CONNS |NGX_HTTP_UPSTREAM_MAX_FAILS |NGX_HTTP_UPSTREAM_FAIL_TIMEOUT |NGX_HTTP_UPSTREAM_DOWN; |