]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: pools: use exponential back-off on shared pool allocation/release
authorWilly Tarreau <w@1wt.eu>
Mon, 24 Jul 2023 13:12:31 +0000 (15:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 12 Aug 2023 17:04:34 +0000 (19:04 +0200)
commitfeeda4132b5677e01e68eec6eab895a4806105a4
tree3be3ae3ca7f9f02f41e23f1fb5544f2c8762d9d7
parentf0d188f6edc81922849b11031783c69e678fac9f
OPTIM: pools: use exponential back-off on shared pool allocation/release

Running a stick-table stress with -dMglobal under 56 threads shows
extreme contention on the pool's free_list because it has to be
processed in two phases and only used to implement a cpu_relax() on
the retry path.

Let's at least implement exponential back-off here to limit the neighbor's
noise and reduce the time needed to successfully acquire the pointer. Just
doing so shows there's still contention but almost doubled the performance,
from 1.1 to 2.1M req/s.
src/pool.c