]> git.kaiwu.me - nginx.git/commitdiff
balance more fair when there are several servers with equal weights,
authorIgor Sysoev <igor@sysoev.ru>
Sun, 9 Sep 2007 18:23:21 +0000 (18:23 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sun, 9 Sep 2007 18:23:21 +0000 (18:23 +0000)
side effect: now smallest weights go first

src/http/ngx_http_upstream_round_robin.c

index 4f017f9224edeec5cd0ef0cf4387c308b2ac4ccd..d0911a04f6e54190b32bef27e7e8c0e809b019c4 100644 (file)
@@ -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;
                 }