Mercurial > hg > nginx
comparison src/http/ngx_http_upstream_round_robin.c @ 1465:a9132739bb57
balance more fair when there are several servers with equal weights,
side effect: now smallest weights go first
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 09 Sep 2007 18:23:21 +0000 |
parents | 1f6898bb813e |
children | 56f1ea5baabb |
comparison
equal
deleted
inserted
replaced
1464:3263e4b17903 | 1465:a9132739bb57 |
---|---|
496 if (peer[i].current_weight <= 0) { | 496 if (peer[i].current_weight <= 0) { |
497 continue; | 497 continue; |
498 } | 498 } |
499 | 499 |
500 if (peer[n].current_weight * 1000 / peer[i].current_weight | 500 if (peer[n].current_weight * 1000 / peer[i].current_weight |
501 >= peer[n].weight * 1000 / peer[i].weight) | 501 > peer[n].weight * 1000 / peer[i].weight) |
502 { | 502 { |
503 return n; | 503 return n; |
504 } | 504 } |
505 | 505 |
506 n = i; | 506 n = i; |