Welcome! Log In Create A New Profile

Advanced

[nginx] Upstream: limited next_upstream time and tries when reso...

Roman Arutyunyan
October 28, 2014 08:50AM
details: http://hg.nginx.org/nginx/rev/5a042519bfe7
branches:
changeset: 5885:5a042519bfe7
user: Gu Feng <flygoast@126.com>
date: Mon Oct 27 19:52:03 2014 +0800
description:
Upstream: limited next_upstream time and tries when resolving DNS.

When got multiple upstream IP addresses using DNS resolving, the number of
upstreams tries and the maxinum time spent for these tries were not affected.
This patch fixed it.

diffstat:

src/http/ngx_http_upstream.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diffs (18 lines):

diff -r 8486205d10db -r 5a042519bfe7 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c Tue Oct 28 12:29:59 2014 +0300
+++ b/src/http/ngx_http_upstream.c Mon Oct 27 19:52:03 2014 +0800
@@ -981,6 +981,14 @@ ngx_http_upstream_resolve_handler(ngx_re
ngx_resolve_name_done(ctx);
ur->ctx = NULL;

+ u->peer.start_time = ngx_current_msec;
+
+ if (u->conf->next_upstream_tries
+ && u->peer.tries > u->conf->next_upstream_tries)
+ {
+ u->peer.tries = u->conf->next_upstream_tries;
+ }
+
ngx_http_upstream_connect(r, u);

failed:

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

[nginx] Upstream: limited next_upstream time and tries when reso...

Roman Arutyunyan 641 October 28, 2014 08:50AM



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

Online Users

Guests: 160
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready