From: Igor Sysoev Date: Sun, 9 Sep 2007 18:23:21 +0000 (+0000) Subject: balance more fair when there are several servers with equal weights, X-Git-Tag: release-0.6.11~8 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=fcd9dda6333ba5696c4b9b6656c09ae10d2faf35;p=nginx.git balance more fair when there are several servers with equal weights, side effect: now smallest weights go first --- diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c index 4f017f922..d0911a04f 100644 --- a/src/http/ngx_http_upstream_round_robin.c +++ b/src/http/ngx_http_upstream_round_robin.c @@ -498,7 +498,7 @@ ngx_http_upstream_get_peer(ngx_http_upstream_rr_peers_t *peers) } if (peer[n].current_weight * 1000 / peer[i].current_weight - >= peer[n].weight * 1000 / peer[i].weight) + > peer[n].weight * 1000 / peer[i].weight) { return n; }