]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: pools: move the shared pool's free_list over multiple buckets
authorWilly Tarreau <w@1wt.eu>
Mon, 24 Jul 2023 15:02:22 +0000 (17:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 12 Aug 2023 17:04:34 +0000 (19:04 +0200)
commit7bf829ace1e90002da9f15cb94234c8104aca21f
tree7767c1a9f474eae51b331e73e31c03d2ae97a858
parent8a0b5f783b201a1194eb5e2901912cec9c9fe091
MAJOR: pools: move the shared pool's free_list over multiple buckets

This aims at further reducing the contention on the free_list when using
global pools. The free_list pointer now appears for each bucket, and both
the alloc and the release code skip to a next bucket when ending on a
contended entry. The default entry used for allocations and releases
depend on the thread ID so that locality is preserved as much as possible
under low contention.

It would be nice to improve the situation to make sure that releases to
the shared pools doesn't consider the first entry's pointer but only an
argument that would be passed and that would correspond to the bucket in
the thread's cache. This would reduce computations and make sure that the
shared cache only contains items whose pointers match the same bucket.
This was not yet done. One possibility could be to keep the same splitting
in the local cache.

With this change, an h2load test with 5 * 160 conns & 40 streams on 80
threads that was limited to 368k RPS with the shared cache jumped to
3.5M RPS for 8 buckets, 4M RPS for 16 buckets, 4.7M RPS for 32 buckets
and 5.5M RPS for 64 buckets.
include/haproxy/pool-t.h
src/pool.c