]> git.kaiwu.me - haproxy.git/commit
MINOR: mux-h2: avoid copying large blocks into full buffers
authorWilly Tarreau <w@1wt.eu>
Wed, 12 Dec 2018 08:17:21 +0000 (09:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 Dec 2018 10:52:45 +0000 (11:52 +0100)
commit06ae84a8ac58159ac1ac6168870821e71409ce09
tree482361a1139336ec58a93a13e0485ef72072e72e
parent142db37043e4d8ee79c143978424285f2a0624a8
MINOR: mux-h2: avoid copying large blocks into full buffers

Due to blocking factor being different on H1 and H2, we regularly end
up with tails of data blocks that leave room in the mux buffer, making
it tempting to copy the pending frame into the remaining room left, and
possibly realigning the output buffer.

Here we check if the output buffer contains data, and prefer to wait
if either the current frame doesn't fit or if it's larger than 1/4 of
the buffer. This way upon next call, either a zero copy, or a larger
and aligned copy will be performed, taking the whole chunk at once.

Doing so increases the H2 bandwidth by slightly more than 1% on large
objects.
src/mux_h2.c