]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: stick-table: make stktable_set_entry() look up under a read lock
authorWilly Tarreau <w@1wt.eu>
Wed, 12 Oct 2022 09:13:14 +0000 (09:13 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 Oct 2022 12:19:05 +0000 (14:19 +0200)
commite62885237c7515ae6284f54ea07cdb68c133231a
tree71a0c6334e9ea85d783982c45e3d9554d536eaf6
parent996f1a51247a43fa236518db067020408131172a
MEDIUM: stick-table: make stktable_set_entry() look up under a read lock

On a 24-core machine having some "stick-store response" rules, a lot of
time is spent in the write lock in stktable_set_entry(). Let's apply the
same mechanism as for the stktable_get_entry() consisting in looking up
the value under the read lock and upgrading it to a write lock only to
perform modifications. Here we even have the luxury of upgrading the
lock since there are no alloc/free in the path. All this increases the
performance by 40% (from 363k to 510k rps).
src/stick_table.c