MINOR: ring: make the number of queues configurable
authorWilly Tarreau <w@1wt.eu>
Thu, 14 Mar 2024 07:57:02 +0000 (08:57 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Mar 2024 17:34:19 +0000 (17:34 +0000)
commit6c1b29d06fc7824d69d14599fe41daf79178bec7
tree7cc9c35a8a41eaa8b4f8d739319310cf5399178a
parente3f101a19aa4ea863078631f56309e428854b9ee
MINOR: ring: make the number of queues configurable

Now the rings have one wait queue per group. This should limit the
contention on systems such as EPYC CPUs where the performance drops
dramatically when using more than one CCX.

Tests were run with different numbers and it was showed that value
6 outperforms all other ones at 12, 24, 48, 64 and 80 threads on an
EPYC, a Xeon and an Ampere CPU. Value 7 sometimes comes close and
anything around these values degrades quickly. The value has been
left tunable in the global section.

This commit only introduces everything needed to set up the queue count
so that it's easier to adjust it in the forthcoming patches, but it was
initially added after the series, making it harder to compare.

It was also shown that trying to group the threads in queues by their
thread groups is counter-productive and that it was more efficient to
do that by applying a modulo on the thread number. As surprising as it
seems, it does have the benefit of well balancing any number of threads.
doc/configuration.txt
include/haproxy/defaults.h
include/haproxy/global-t.h
include/haproxy/ring-t.h
include/haproxy/tinfo-t.h
src/haproxy.c
src/ring.c