Permalink
Browse files

Only choose peers without failures in the fair balancer fast path

  • Loading branch information...
1 parent 4329e70 commit 93d5f6424dc3ed65d946ddd65140954cf21830db @gnosek committed Mar 8, 2008
Showing with 1 addition and 0 deletions.
  1. +1 −0 ngx_http_upstream_fair_module.c
View
1 ngx_http_upstream_fair_module.c
@@ -508,6 +508,7 @@ ngx_http_upstream_choose_fair_peer(ngx_peer_connection_t *pc,
/* any idle backends? */
for (i = 0, n = fp->current; i < npeers; i++, n = (n + 1) % npeers) {
if (ngx_atomic_fetch_add(&fp->shared[n].nreq, 0) == 0 &&
+ fp->rrp->peer[n].fails == 0 &&
ngx_http_upstream_fair_try_peer(pc, fp, n, now) == NGX_OK) {
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, "[upstream_fair] peer %i is idle", n);

0 comments on commit 93d5f64

Please sign in to comment.