mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-20 12:46:56 +00:00
haproxy public development tree
It's long been known that queues didn't scale with threads for various reasons ranging from the cost of the queue lock to the cost of the massive amount of inter-thread wakeups. But some recent reports showing deplorable perfs with threads used at 100% CPU helped us notice that the two elements above add on top of each other: - with plenty of inter-thread wakeups, the scheduler takes a lot of time to dequeue pending tasks from the shared queue ; - the lock held by the scheduler to do this slows down subsequent task_wakeup() calls from the the queue that are made under the queue's lock - the queue's lock slows down addition of new requests to the queue and adds up to the number of needed queue entries for a steady traffic. But the cost of the share queue has no reason for being paid because it had already been paid when process_stream() added the request to the queue. As such an instant wakeup is perfectly fit for this. This is exactly what this patch does, it uses tasklet_instant_wakeup() to dequeue pending requests, which has the effect of not bloating the shared queue, hence not requiring the global queue lock, which in turn results in the wakeup to be much faster, and the queue lock to be much shorter. In the end, a test with 4k concurrent connections that was being limited to 40-80k requests/s before with 16 threads, some of which were stuck at 100% CPU now reaches 570k req/s with 4% idle. Given that it's been found that it was possible to trigger the watchdog on the queue lock under extreme conditions, and that such conditions could happen when users want to protect their servers during a DoS, it would definitely make sense to backport it to the most recent releases (2.5 and 2.4 seem like good candidates especially because their scheduler is modern enough to receive the change above). If a backport is performed, the following patch is needed: MINOR: task: add a new task_instant_wakeup() function |
||
---|---|---|
.github | ||
addons | ||
admin | ||
dev | ||
doc | ||
examples | ||
include | ||
reg-tests | ||
scripts | ||
src | ||
tests | ||
.cirrus.yml | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.travis.yml | ||
BRANCHES | ||
CHANGELOG | ||
CONTRIBUTING | ||
INSTALL | ||
LICENSE | ||
MAINTAINERS | ||
Makefile | ||
README | ||
ROADMAP | ||
SUBVERS | ||
VERDATE | ||
VERSION |
The HAProxy documentation has been split into a number of different files for ease of use. Please refer to the following files depending on what you're looking for : - INSTALL for instructions on how to build and install HAProxy - BRANCHES to understand the project's life cycle and what version to use - LICENSE for the project's license - CONTRIBUTING for the process to follow to submit contributions The more detailed documentation is located into the doc/ directory : - doc/intro.txt for a quick introduction on HAProxy - doc/configuration.txt for the configuration's reference manual - doc/lua.txt for the Lua's reference manual - doc/SPOE.txt for how to use the SPOE engine - doc/network-namespaces.txt for how to use network namespaces under Linux - doc/management.txt for the management guide - doc/regression-testing.txt for how to use the regression testing suite - doc/peers.txt for the peers protocol reference - doc/coding-style.txt for how to adopt HAProxy's coding style - doc/internals for developer-specific documentation (not all up to date)