]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[MAJOR] buffer: flag BF_DONT_READ to disable reads when not required
authorWilly Tarreau <w@1wt.eu>
Sat, 17 Oct 2009 12:37:52 +0000 (14:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 18 Oct 2009 06:52:24 +0000 (08:52 +0200)
commitf1ba4b3de56e857862f0c2b4d40541487a724a7c
treeb65f0a20c749c906b2a4711fd58f85465e201ded
parentb48b323223da50c1222f8fddcb9b296ca28c6601
[MAJOR] buffer: flag BF_DONT_READ to disable reads when not required

When processing a GET or HEAD request in close mode, we know we don't
need to read anything anymore on the socket, so we can disable it.
Doing this can save up to 40% of the recv calls, and half of the
epoll_ctl calls.

For this we need a buffer flag indicating that we're not interesting in
reading anymore. Right now, this flag also disables both polled reads.
We might benefit from disabling only speculative reads, but we will need
at least this flag when we want to support keepalive anyway.

Currently we don't disable the flag on completion, but it does not
matter as we close ASAP when performing the shutw().
include/types/buffers.h
src/proto_http.c
src/stream_interface.c
src/stream_sock.c