MEDIUM: stick-tables: Limit the number of old entries we remove
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 2 May 2025 12:05:37 +0000 (12:05 +0000)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 May 2025 15:35:07 +0000 (17:35 +0200)
commit64d4c5ab846f853f94d1dcd1d1f4c8ee74508832
tree6d1cdf77bb1a395cfc52eef80567b04d06f31976
parente106c8f8f1068fba0923dd3348c6e7cb0bc499ab
MEDIUM: stick-tables: Limit the number of old entries we remove

Limit the number of old entries we remove in one call of
stktable_trash_oldest(), as we do so while holding the heavily contended
update write lock, so we'd rather not hold it for too long.
This helps getting stick tables perform better under heavy load.

(cherry picked from commit d2d4c3eb6566145d30eb38dc96b2b79d3f1db8fc)
[wt: backported since situation encountered in 3.1 as well without this
 patch. It also contains the definition for STKTABLE_MAX_UPDATES_AT_ONCE
 from the previous commit]
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/defaults.h
src/stick_table.c