diff options
| author | Ruslan Ermilov <ru@nginx.com> | 2015-05-20 22:44:00 +0300 |
|---|---|---|
| committer | Ruslan Ermilov <ru@nginx.com> | 2015-05-20 22:44:00 +0300 |
| commit | 941a6995d76d9d3fe74247ce2e4d356650ed987a (patch) | |
| tree | 2414009c660049e0b5e813e1c7ea2e02a2f1ed8b | |
| parent | f7f1607bf2b8b7c45834b66cb45f6445bee65587 (diff) | |
| download | nginx-941a6995d76d9d3fe74247ce2e4d356650ed987a.tar.gz nginx-941a6995d76d9d3fe74247ce2e4d356650ed987a.tar.bz2 | |
Upstream: report to error_log when max_fails is reached.
This can be useful to understand why "no live upstreams" happens,
in particular.
| -rw-r--r-- | src/http/ngx_http_upstream_round_robin.c | 5 | ||||
| -rw-r--r-- | src/stream/ngx_stream_upstream_round_robin.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c index 487b0e3cc..d6ae33bf1 100644 --- a/src/http/ngx_http_upstream_round_robin.c +++ b/src/http/ngx_http_upstream_round_robin.c @@ -622,6 +622,11 @@ ngx_http_upstream_free_round_robin_peer(ngx_peer_connection_t *pc, void *data, 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 --git a/src/stream/ngx_stream_upstream_round_robin.c b/src/stream/ngx_stream_upstream_round_robin.c index c9157cd99..efedb2882 100644 --- a/src/stream/ngx_stream_upstream_round_robin.c +++ b/src/stream/ngx_stream_upstream_round_robin.c @@ -495,6 +495,11 @@ ngx_stream_upstream_free_round_robin_peer(ngx_peer_connection_t *pc, void *data, 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, |
