]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM: connection: disable receiving on disabled events when the run queue is too...
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Mar 2020 17:33:19 +0000 (18:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Mar 2020 18:29:12 +0000 (19:29 +0100)
commit6f95f6e111304c40fd18eee78a7e3372596d599f
tree3eb366247f2b9aedbdbeb452fbed40c8c4e373d2
parent8de5c4fa15d612bd70456881f8fef13b8fe37e2a
OPTIM: connection: disable receiving on disabled events when the run queue is too high

In order to save a lot on syscalls, we currently don't disable receiving
on a file descriptor anymore if its handler was already woken up. But if
the run queue is huge and the poller collects a lot of events, this causes
excess wakeups which take CPU time which is not used to flush these tasklets.
This patch simply considers the run queue size to decide whether or not to
stop receiving. Tests show that by stopping receiving when the run queue
reaches ~16 times its configured size, we can still hold maximal performance
in extreme situations like maxpollevents=20k for runqueue_depth=2, and still
totally avoid calling epoll_event under moderate load using default settings
on keep-alive connections.
src/connection.c