]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: backend: switch the default balancing algo to "random"
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Sep 2025 06:23:30 +0000 (08:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 4 Sep 2025 06:30:35 +0000 (08:30 +0200)
commit93cc18ac4286f0e0d5f870591d06c50228d128ac
treebbf7e3e654b3bc8d60f98d605440e9b764b23622
parent60931ceae9bd52db27dde002af2fe3232cd2b811
MAJOR: backend: switch the default balancing algo to "random"

For many years, an unset load balancing algorithm would use "roundrobin".
It was shown several times that "random" with at least 2 draws (the
default) generally provides better performance and fairness in that
it will automatically adapt to the server's load and capacity. This
was further described with numbers in this discussion:

  https://www.mail-archive.com/haproxy@formilux.org/msg46011.html
  https://github.com/orgs/haproxy/discussions/3042

BTW there were no objection and only support for the change.

The goal of this patch is to change the default algo when none is
specified, from "roundrobin" to "random". This way, users who don't
care and don't set the load balancing algorithm will benefit from a
better one in most cases, while those who have good reasons to prefer
roundrobin (for session affinity or for reproducible sequences like used
in regtests) can continue to specify it.

The vast majority of users should not notice a difference.
doc/configuration.txt
src/backend.c
src/cfgparse.c