]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: mux-h1: pass CO_RFL_READ_ONCE to the lower layers when relevant
authorWilly Tarreau <w@1wt.eu>
Thu, 20 Feb 2020 10:11:50 +0000 (11:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 21 Feb 2020 10:38:50 +0000 (11:38 +0100)
commit6e59cb5db18406e961483693c2fed44f99a4b838
tree5b1c61d4e9426f1f92736434e1a2bb49207747c3
parent716bec2dc6f9784200c9c785bd0880d33bf75e8d
MINOR: mux-h1: pass CO_RFL_READ_ONCE to the lower layers when relevant

When we're in H1_MSG_RQBEFORE or H1_MSG_RPBEFORE, we know that the
first message is highly likely the only one and that it's pointless
to try to perform a second recvfrom() to complete a first partial
read. This is similar to what used to be done in the older I/O methods
with the CF_READ_DONTWAIT flag on the channel. So let's pass
CO_RFL_READ_ONCE to the transport layer during rcv_buf() in this case.

By doing so, in a test involving keep-alive connections with a non-null
client think time, we remove 20% of the recvfrom() calls, all of which
used to systematically fail. More precisely, we observe a drop from 5.0
recvfrom() per request with 60% failure to 4.0 per request with 50%
failure.
src/mux_h1.c