mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-26 00:01:45 +02:00
The next thread walking algorithm in commit 566df309c ("MEDIUM: connections: Attempt to get idle connections from other threads.") proved to be sufficient for most cases, but it still has some rough edges when threads are unevenly loaded. If one thread wakes up with 10 streams to process in a burst, it will mainly take over connections from the next one until it doesn't have anymore. This patch implements a rotating index that is stored into the server list and that any thread taking over a connection is responsible for updating. This way it starts mostly random and avoids always picking from the same place. This results in a smoother distribution overall and a slightly lower takeover rate.