]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: queue: use a trylock on the server's queue
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Jun 2021 06:30:07 +0000 (08:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Jun 2021 08:52:31 +0000 (10:52 +0200)
commitae0b12ee0349e1ab2c54b0718fee0f9caed51caa
treed62220cdbc07322966a901065fdea798b4baddb8
parent49667c14ba15e0798be145635c80c809ffeaa44b
MEDIUM: queue: use a trylock on the server's queue

Doing so makes sure that threads attempting to wake up new connections
for a server will give up early if another thread is already in charge
of this. The goal is to avoid unneeded contention on low server counts.

Now with a single server with 16 threads in roundrobin we get the same
performance as with multiple servers, i.e. ~575kreq/s instead of ~496k
before. Leastconn is seeing a similar jump, from ~460 to ~560k (the
difference being the calls to fwlc_srv_reposition).

The overhead of process_srv_queue() is now around 2% instead of ~20%
previously.
src/queue.c