]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: server: compute a "cumulative weight" to allow chash balancing to hit its...
authorAndrew Rodland <andrewr@vimeo.com>
Tue, 25 Oct 2016 16:49:45 +0000 (12:49 -0400)
committerWilly Tarreau <w@1wt.eu>
Tue, 25 Oct 2016 18:21:32 +0000 (20:21 +0200)
commit13d5ebb91361c001286dd3ca91481d98d75ed031
tree59436313896cee1e2835a4095b43ecaaea50daf9
parentb1f48e316149cacc91c63a2878ab170e59d579e6
MINOR: server: compute a "cumulative weight" to allow chash balancing to hit its target

For active servers, this is the sum of the eweights of all active
servers before this one in the backend, and
[srv->cumulative_weight .. srv_cumulative_weight + srv_eweight) is a
space occupied by this server in the range [0 .. lbprm.tot_wact), and
likewise for backup servers with tot_wbck. This allows choosing a
server or a range of servers proportional to their weight, by simple
integer comparison.

Signed-off-by: Andrew Rodland <andrewr@vimeo.com>
include/types/server.h
src/backend.c