]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: stick-tables: check the stksess without taking the read lock
authorWilly Tarreau <w@1wt.eu>
Tue, 2 Apr 2024 17:04:12 +0000 (19:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 3 Apr 2024 15:34:47 +0000 (17:34 +0200)
commit864ac311740ff69b32326eb8f92045d683c827af
tree2b24db33765a99835dba1968e83fa8dc584753a5
parent4c1480f13b02326f50be2c7586c20eb8bf4e6a30
OPTIM: stick-tables: check the stksess without taking the read lock

Thanks to the previous commit, we can now simply perform an atomic read
on stksess->seen and take the write lock to recreate the entry only if
at least one peer has seen it, otherwise leave it untouched. On a test
on 40 cores, the performance used to drop from 2.10 to 1.14M RPS when
one peer was connected, now it drops to 2.05, thus there's basically
no impact of connecting a peer vs ~45% previously, all spent in the
read lock. This can be particularly important when often updating the
same entries (user-agent, source address during an attack etc).
src/stick_table.c