MEDIUM: queue: move the queue lock manipulation to pendconn_process_next_strm()
authorWilly Tarreau <w@1wt.eu>
Fri, 18 Jun 2021 17:57:34 +0000 (19:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Jun 2021 16:57:18 +0000 (18:57 +0200)
commit9a6d0ddbd6788a05c6730bf0e9e8550d7c5b11aa
tree2dfe2dcbb2339dbd80a33a14a8501429c1c1cef0
parentde814dd4228fa5e528d9ac1f0e1c4c7325ee52d3
MEDIUM: queue: move the queue lock manipulation to pendconn_process_next_strm()

By placing the lock there, it becomes possible to lock the proxy
later and to unlock it earlier. The server unlocking also happens slightly
earlier.

The performance on roundrobin increases from 481k to 524k req/s on 16
threads. Leastconn shows about 513k req/s (the difference being the
take_conn() call).

The performance profile changes from this:
   9.32%  hap-pxok            [.] process_srv_queue
   7.56%  hap-pxok            [.] pendconn_dequeue
   6.90%  hap-pxok            [.] pendconn_add

to this:
   7.42%  haproxy             [.] process_srv_queue
   5.61%  haproxy             [.] pendconn_dequeue
   4.95%  haproxy             [.] pendconn_add
src/queue.c