Welcome! Log In Create A New Profile

Advanced

[nginx] Upstream: report to error_log when max_fails is reached.

Ruslan Ermilov
May 20, 2015 03:46PM
details: http://hg.nginx.org/nginx/rev/cca856715722
branches:
changeset: 6154:cca856715722
user: Ruslan Ermilov <ru@nginx.com>
date: Wed May 20 22:44:00 2015 +0300
description:
Upstream: report to error_log when max_fails is reached.

This can be useful to understand why "no live upstreams" happens,
in particular.

diffstat:

src/http/ngx_http_upstream_round_robin.c | 5 +++++
src/stream/ngx_stream_upstream_round_robin.c | 5 +++++
2 files changed, 10 insertions(+), 0 deletions(-)

diffs (30 lines):

diff -r 4f6efabcb09b -r cca856715722 src/http/ngx_http_upstream_round_robin.c
--- a/src/http/ngx_http_upstream_round_robin.c Wed May 20 15:51:56 2015 +0300
+++ b/src/http/ngx_http_upstream_round_robin.c Wed May 20 22:44:00 2015 +0300
@@ -622,6 +622,11 @@ ngx_http_upstream_free_round_robin_peer(

if (peer->max_fails) {
peer->effective_weight -= peer->weight / peer->max_fails;
+
+ if (peer->fails >= peer->max_fails) {
+ ngx_log_error(NGX_LOG_WARN, pc->log, 0,
+ "upstream server temporarily disabled");
+ }
}

ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
diff -r 4f6efabcb09b -r cca856715722 src/stream/ngx_stream_upstream_round_robin.c
--- a/src/stream/ngx_stream_upstream_round_robin.c Wed May 20 15:51:56 2015 +0300
+++ b/src/stream/ngx_stream_upstream_round_robin.c Wed May 20 22:44:00 2015 +0300
@@ -495,6 +495,11 @@ ngx_stream_upstream_free_round_robin_pee

if (peer->max_fails) {
peer->effective_weight -= peer->weight / peer->max_fails;
+
+ if (peer->fails >= peer->max_fails) {
+ ngx_log_error(NGX_LOG_WARN, pc->log, 0,
+ "upstream server temporarily disabled");
+ }
}

ngx_log_debug2(NGX_LOG_DEBUG_STREAM, pc->log, 0,

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

[nginx] Upstream: report to error_log when max_fails is reached.

Ruslan Ermilov 1322 May 20, 2015 03:46PM



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

Online Users

Guests: 264
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