MINOR: lb/first: use a read lock in fas_get_next_server()
authorWilly Tarreau <w@1wt.eu>
Sat, 17 Oct 2020 17:45:42 +0000 (19:45 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 17 Oct 2020 17:49:49 +0000 (19:49 +0200)
commitf76a21f78c2066f74fb04875006e08bc7a9413db
tree7df552bfb1964e8327fce1339251569ad8fec454
parent58bc9c1ced43b7802200d4d71e0eb5f850e0e801
MINOR: lb/first: use a read lock in fas_get_next_server()

The "first" algorithm creates a lot of contention because all threads
focus on the same server by definition (the first available one). By
turning the exclusive lock to a read lock in fas_get_next_server(),
the request rate increases by 16% for 8 threads when many servers are
getting close to their maxconn.
src/lb_fas.c