]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: stream_interface: disable reading when CF_READ_DONTWAIT is set
authorWilly Tarreau <w@1wt.eu>
Fri, 9 Nov 2012 17:27:26 +0000 (18:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Nov 2012 23:23:38 +0000 (00:23 +0100)
commit5fddab0a56fb6c7524d1edcff5a2ad1927675c79
tree072425c838419785b5084d3f0e5b9cdefb4e19b3
parent037d2c1f8fd6c505f2b44f56b642f2863c17ed4f
OPTIM: stream_interface: disable reading when CF_READ_DONTWAIT is set

CF_READ_DONTWAIT was designed to avoid getting an EAGAIN upon recv() when
very few data are expected. It prevents the reader from looping over
recv(). Unfortunately with speculative I/O, it is very common that the
same event has the time to be called twice before the task handles the
data and disables the recv(). This is because not all tasks are always
processed at once.

Instead of leaving the buffer free-wheeling and doing an EAGAIN, we
disable reading as soon as the first recv() succeeds. This way we're
sure that only the next wakeup of the task will re-enable it if needed.

Doing so has totally removed the EAGAIN we were seeing till now (30% of
recv).
src/stream_interface.c