]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: lb_fwrr: Use one ebtree per thread group.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 17 Apr 2025 14:31:44 +0000 (16:31 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 17 Apr 2025 15:38:23 +0000 (17:38 +0200)
commit3758eab71c50180ca161e489789c9238688e778d
tree7990315100aa98ac17a64708bbd251e6b5290def
parentf36f6cfd26762f81950e31ace501fc2311bbc279
MEDIUM: lb_fwrr: Use one ebtree per thread group.

When using the round-robin load balancer, the major source of contention
is the lbprm lock, that has to be held every time we pick a server.
To mitigate that, make it so there are one tree per thread-group, and
one lock per thread-group. That means we now have a lb_fwrr_per_tgrp
structure that will contain the two lb_fwrr_groups (active and backup) as well
as the lock to protect them in the per-thread lbprm struct, and all
fields in the struct server are now moved to the per-thread structure
too.
Those changes are mostly mechanical, and brings good performances
improvment, on a 64-cores AMD CPU, with 64 servers configured, we could
process about 620000 requests par second, and we now can process around
1400000 requests per second.
include/haproxy/backend-t.h
include/haproxy/lb_fwrr-t.h
include/haproxy/server-t.h
src/lb_fwrr.c