Welcome! Log In Create A New Profile

Advanced

[nginx] Upstream: get rid of questionable micro-optimization in ...

Ruslan Ermilov
April 16, 2015 01:12PM
details: http://hg.nginx.org/nginx/rev/55dc5f7eb921
branches:
changeset: 6108:55dc5f7eb921
user: Ruslan Ermilov <ru@nginx.com>
date: Thu Apr 16 20:09:11 2015 +0300
description:
Upstream: get rid of questionable micro-optimization in ip_hash.

If a peer was initially skipped due to max_fails, there's no reason
not to try it again if enough time has passed, and the next_upstream
logic is in action.

This also reduces diffs with NGINX Plus.

diffstat:

src/http/modules/ngx_http_upstream_ip_hash_module.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)

diffs (29 lines):

diff -r cb790d1b2d16 -r 55dc5f7eb921 src/http/modules/ngx_http_upstream_ip_hash_module.c
--- a/src/http/modules/ngx_http_upstream_ip_hash_module.c Thu Apr 16 18:18:37 2015 +0300
+++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c Thu Apr 16 20:09:11 2015 +0300
@@ -216,23 +216,18 @@ ngx_http_upstream_get_ip_hash_peer(ngx_p
"get ip hash peer, hash: %ui %04XA", p, m);

if (peer->down) {
- goto next_try;
+ goto next;
}

if (peer->max_fails
&& peer->fails >= peer->max_fails
&& now - peer->checked <= peer->fail_timeout)
{
- goto next_try;
+ goto next;
}

break;

- next_try:
-
- iphp->rrp.tried[n] |= m;
- pc->tries--;
-
next:

if (++iphp->tries > 20) {

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Upstream: get rid of questionable micro-optimization in ...

Ruslan Ermilov 480 April 16, 2015 01:12PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 129
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready