OPTIM: server: switch the actconn list to an mt-list
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Feb 2021 12:33:24 +0000 (13:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 10 Mar 2021 14:11:15 +0000 (15:11 +0100)
commit49e1080765627db53eb10d18a510613e92d3ed7a
tree651a193d5287d268064fb84070397071ec7f89f6
parent8fa7f228a33881992ec27d315d7cd6544446c273
OPTIM: server: switch the actconn list to an mt-list

The remaining contention on the server lock solely comes from
sess_change_server() which takes the lock to add and remove a
stream from the server's actconn list. This is both expensive
and pointless since we have mt-lists, and this list is only
used by the CLI's "shutdown server sessions" command!

Let's migrate to an mt-list and remove the need for this costly
lock. By doing so, the request rate increased by ~1.8%.

(cherry picked from commit 751153e0f119bec90455cda95166f1b29d8b0326)
[wt: the contention is extreme on high threads counts, thus this
     actconn series is backported; ctx adjustments]
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/server-t.h
include/haproxy/stream-t.h
include/haproxy/stream.h
src/hlua.c
src/queue.c
src/server.c
src/stream.c