]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: connection: reintegrate conn_hash_node into connection
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Sep 2025 16:12:18 +0000 (18:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 16 Sep 2025 07:23:46 +0000 (09:23 +0200)
commit2d6b5c7a60e96fa2eda331f42bb2a4cea6882197
treed5b8b03cb91c00db527981544a3da63281f428c1
parentceaf8c1220accbdd80c1c77626d69286cc28f0f9
MEDIUM: connection: reintegrate conn_hash_node into connection

Previously the conn_hash_node was placed outside the connection due
to the big size of the eb64_node that could have negatively impacted
frontend connections. But having it outside also means that one
extra allocation is needed for each backend connection, and that one
memory indirection is needed for each lookup.

With the compact trees, the tree node is smaller (16 bytes vs 40) so
the overhead is much lower. By integrating it into the connection,
We're also eliminating one pointer from the connection to the hash
node and one pointer from the hash node to the connection (in addition
to the extra object bookkeeping). This results in saving at least 24
bytes per total backend connection, and only inflates connections by
16 bytes (from 240 to 256), which is a reasonable compromise.

Tests on a 64-core EPYC show a 2.4% increase in the request rate
(from 2.08 to 2.13 Mrps).
include/haproxy/connection-t.h
include/haproxy/connection.h
src/backend.c
src/connection.c
src/mux_fcgi.c
src/mux_h2.c
src/mux_quic.c
src/mux_spop.c
src/server.c
src/session.c