]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: listener: add the "shards" bind keyword
authorWilly Tarreau <w@1wt.eu>
Tue, 12 Oct 2021 13:23:03 +0000 (15:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Oct 2021 19:27:48 +0000 (21:27 +0200)
commit6dfbef4145845a421e5d9301e26cbc7136d20965
tree34bb0df5195c6157864d628ce10a3d0caa24fa48
parent59a877dfd91211879c3a01c335ae45221c755ed8
MEDIUM: listener: add the "shards" bind keyword

In multi-threaded mode, on operating systems supporting multiple listeners on
the same IP:port, this will automatically create this number of multiple
identical listeners for the same line, all bound to a fair share of the number
of the threads attached to this listener. This can sometimes be useful when
using very large thread counts where the in-kernel locking on a single socket
starts to cause a significant overhead. In this case the incoming traffic is
distributed over multiple sockets and the contention is reduced. Note that
doing this can easily increase the CPU usage by making more threads work a
little bit.

If the number of shards is higher than the number of available threads, it
will automatically be trimmed to the number of threads. A special value
"by-thread" will automatically assign one shard per thread.
doc/configuration.txt
include/haproxy/receiver-t.h
src/cfgparse.c
src/listener.c