]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: mux-h2/zero-copy: don't allocate more buffers per connections than streams
authorWilly Tarreau <w@1wt.eu>
Tue, 28 Nov 2023 08:15:26 +0000 (09:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 28 Nov 2023 08:15:26 +0000 (09:15 +0100)
commitd656ac7e13266c3725e196c510eb0871d8792547
tree7d3dd2d221ae8cb7a0c4ab3399f05f62dc1bc169
parente97489a526e5ef2a48b747660e0faf3db5b052d2
OPTIM: mux-h2/zero-copy: don't allocate more buffers per connections than streams

It's the exact same as commit 0a7ab7067 ("OPTIM: mux-h2: don't allocate
more buffers per connections than streams"), but for the zero-copy case
this time. Previously it was only done on the regular snd_buf() path, but
this one is needed as well. A transfer on 16 parallel streams now consumes
half of the memory, and a single stream consumes much less.

An alternate approach would be worth investigating in the future, based
on the same principle as the CF_STREAMER_FAST at the higher level: in
short, by monitoring how many mux buffers we write at once before refilling
them, we would get an idea of how much is worth keeping in buffers max,
given that anything beyond would just waste memory. Some tests show that
a single buffer already seems almost as good, except for single-stream
transfers, which is why it's worth spending more time on this.
src/mux_h2.c