]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: threads/queue: wake up other threads upon dequeue
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 19 Mar 2018 14:22:09 +0000 (15:22 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 19 Mar 2018 21:16:58 +0000 (22:16 +0100)
commitfd83f0bfa414ba7463450b99f86858cf33fa285b
tree6c6e6d28525b210cc0841b499badcb444e304ace
parent2f3a56b4ff207de37bdd944993a88bca781ad243
BUG/MEDIUM: threads/queue: wake up other threads upon dequeue

The previous patch about queues (5cd4bbd7a "BUG/MAJOR: threads/queue: Fix
thread-safety issues on the queues management") revealed a performance drop when
multithreading is enabled (nbthread > 1). This happens when pending connections
handled by other theads are dequeued. If these other threads are blocked in the
poller, we have to wait the poller's timeout (or any I/O event) to process the
dequeued connections.

To fix the problem, at least temporarly, we "wake up" the threads by requesting
a synchronization. This may seem a bit overkill to use the sync point to do a
wakeup on threads, but it fixes this performance issue. So we can now think
calmly on the good way to address this kind of issues.

This patch should be backported in 1.8 with the commit 5cd4bbd7a ("BUG/MAJOR:
threads/queue: Fix thread-safety issues on the queues management").
src/queue.c