]> git.kaiwu.me - haproxy.git/commit
DOC: config: explain the effect of the weights on random's draws master
authorAleksandar Lazic <al-haproxy@none.at>
Fri, 30 Oct 2026 23:31:38 +0000 (00:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 13 Nov 2026 16:31:34 +0000 (17:31 +0100)
commited3ba6581d2ced912ad296065027fd23d4e30839
tree227f6152458932ebb689c5babb68940058878bdd
parente6ed42090abca3ecd232004b95b8593fba3e9aea
DOC: config: explain the effect of the weights on random's draws

"balance random" draws the servers on the consistent hash ring, where a
server gets 16 points per unit of weight. With the default weight of 1,
the shares of the ring are uneven (between about 2% and 4% for 32
servers, computed from the ring), so some servers are drawn twice as
often as others. Using the same higher weight for all servers, such as
100, makes the shares almost even.

Measured on 32 servers with 4 slow ones (with the peak EWMA option under
review, which compares the response times of the drawn servers), raising
the weight of all servers from 1 to 100 brought the share of the
requests sent to the slow servers from 2.0% to 1.5%, the same as a
uniform draw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Aleksandar Lazic <al-haproxy@none.at>
doc/configuration.txt