BUG/MINOR: mux-h2: set CO_SFL_STREAMER when sending lots of data
authorWilly Tarreau <w@1wt.eu>
Thu, 16 Mar 2023 16:30:30 +0000 (17:30 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 16 Mar 2023 17:45:46 +0000 (18:45 +0100)
commit14ea98af7392225c26afa9f97a33b913e091b02b
treecbf051d760b5fb720ec106cd322dcd5e464644bf
parent93c5511af8962d17c94e83d23e6568c4759c8eb6
BUG/MINOR: mux-h2: set CO_SFL_STREAMER when sending lots of data

Emeric noticed that h2 bit-rate performance was always slightly lower
than h1 when the CPU is saturated. Strace showed that we were always
data in 2kB chunks, corresponding to the max_record size. What's
happening is that when this mechanism of dynamic record size was
introduced, the STREAMER flag at the stream level was relied upon.
Since all this was moved to the muxes, the flag has to be passed as
an argument to the snd_buf() function, but the mux h2 did not use it
despite a comment mentioning it, probably because before the multi-buf
it was not easy to figure the status of the buffer.

The solution here consists in checking if the mbuf is congested or not,
by checking if it has more than one buffer allocated. If so we set the
CO_SFL_STREAMER flag, otherwise we don't. This way moderate size
exchanges continue to be made over small chunks, but downloads will
be able to use the large ones.

While it could be backported to all supported versions, it would be
better to limit it to the last LTS, so let's do it for 2.7 and 2.6 only.
This patch requires previous commit "MINOR: buffer: add br_single() to
check if a buffer ring has more than one buf".
src/mux_h2.c