]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: sink: "max-reuse" support for sink servers
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 22 Jul 2024 14:55:30 +0000 (16:55 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Wed, 24 Jul 2024 15:59:14 +0000 (17:59 +0200)
commit237849c911f6d7772c1f5eb4e91644f9b32196bc
tree2c49e78c9e8156c6b9b0c9136aa52dd4d3f6ae43
parent709b3db941d4e4dd4613618d893f6bcb46ddac02
MEDIUM: sink: "max-reuse" support for sink servers

Thanks to the previous commit, it is now possible to know how many events
were processed for a given sft/server sink pair. As mentioned in commit
c454296 ("OPTIM: sink: balance applets accross threads"), let's provide
the ability to restart a server connection when a certain amount of events
were processed to help better balance the load over multiple threads.

For this, we make use the of "max-reuse" server keyword which was only
relevant under "http" context so far. Under sink context, "max-reuse"
corresponds to the number of times the tcp connection can be reused
for sending messages, which in fact means that "max-reuse + 1" is the
number of events (ie: messages) that are allowed to be sent using the
same tcp server connection: when this threshold is met, the connection
will be destroyed and a new one will be created on a random thread.
The value is not strict: it is the minimum value above which the
connection may be destroyed since the value is checked after
ring_dispatch_messages() which may process multiple messages at once.

By default, no limit is enforced (the connection will be reused for as
long as it is available).

The documentation was updated accordingly.
doc/configuration.txt
src/sink.c