mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
HAProxy - Load balancer
When waking a task on a remote thread, we currently check 1) if this thread was sleeping, and 2) if it was already marked as active before writing to its pipe. Unfortunately this doesn't always work as desired because only one thread from the mask is woken up, while the active_tasks_mask indicates all eligible threads for this task. As a result, if one multi-thread task (e.g. a health check) wakes up to run on any thread, then an accept() dispatches an incoming connection on thread 2, this thread will already have its bit set in active_tasks_mask because of the previous wakeup and will not be woken up. This is easily noticeable on 2.0-dev by injecting on a multi-threaded listener with a single connection at a time while health checks are running quickly in the background : the injection runs slowly with random response times (the poll timeouts). In 1.9 it affects the dequeing of server connections, which occasionally experience pauses if multiple threads share the same queue. The correct solution consists in adjusting the sleeping_thread_mask when waking another thread up. This mask reflects threads that are sleeping, hence that need to be signaled to wake up. Threads with a bit in active_tasks_mask already don't have their sleeping_thread_mask bit set before polling so the principle remains consistent. And by doing so we can remove the old_active_mask field. This should be backported to 1.9. |
||
|---|---|---|
| .github/ISSUE_TEMPLATE | ||
| contrib | ||
| doc | ||
| ebtree | ||
| examples | ||
| include | ||
| reg-tests | ||
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| 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 - 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)