Welcome! Log In Create A New Profile

Advanced

[PATCH] epoll: the listener socket use EPOLLEXCLUSIVE flag

Posted by 龙红波 
Hi, all,
haproxy still have the thundering herd problem in the multi-process
mode, the EPOLLEXCLUSIVE flag has been added since linux 4.5, which can
solve this problem
Attachments:
open | download - 0001-epoll-the-listener-socket-use-EPOLLEXCLUSIVE-flag.patch (2.9 KB)
Hi,

On Tue, Apr 10, 2018 at 08:38:32PM +0800, ??? wrote:
> Hi, all,
> haproxy still have the thundering herd problem in the multi-process
> mode, the EPOLLEXCLUSIVE flag has been added since linux 4.5, which can
> solve this problem

Well I disagree with this approach, it will instead degrade the situation.
Let me explain.

Right now when working in multi-process mode, it is strongly suggested to
use multiple "bind" lines each with its own process. When this is done,
the sockets are bound with SO_REUSEPORT, where the kernel performs some
round-robin load balancing between all the sockets, and each process
receiving connections will be woken up and will be able to accept at
once *all* pending connections for its listener.

With your approach what will happen is that a single process will be
woken up for multiple pending requests at once, it will suck them all
in a loop without leaving a chance to the other processes to take their
share. This creates a huge imbalance that is already visible when using
nbproc without the "process" directive on the bind lines. With SSL this
has an even worse impact since a process can steal a lot of traffic and
spend a lot of time in handshakes while the other ones are twidling
thumbs.

Regards,
Willy
Sorry, only registered users may post in this forum.

Click here to login