mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-02-04 17:01:24 +01:00
Since version 1.8, we've started to use tasks and tasklets more extensively to defer I/O processing. Originally with the simple scheduler, a task waking another one up using task_wakeup() would have caused it to be processed right after the list of runnable ones. With the introduction of tasklets, we've started to spill running tasks from the run queues to the tasklet queues, so if a task wakes another one up, it will only be executed on the next call to process_runnable_task(), which means after yet another round of polling loop. This is particularly visible with I/Os hitting muxes: poll() reports a read event, the connection layer performs a tasklet_wakeup() on the mux subscribed to this I/O, and this mux in turn signals the upper layer stream using task_wakeup(). The process goes back to poll() with a null timeout since there's one active task, then back to checking all possibly expired events, and finally back to process_runnable_tasks() again. Worse, when there is high I/O activity, doing so will make the task's execution further apart from the tasklet and will both increase the total processing latency and reduce the cache hit ratio. This patch brings back to the original spirit of process_runnable_tasks() which is to execute runnable tasks as long as the execution budget is not exhausted. By doing so, we're immediately cutting in half the number of calls to all functions called by run_poll_loop(), and halving the number of calls to poll(). Furthermore, calling poll() less often also means purging FD updates less often and offering more chances to merge them. This also has the nice effect of making tune.runqueue-depth effective again, as in the past it used to be quickly bounded by this artificial event horizon which was preventing from executing remaining tasks. On certain workloads we can see a 2-3% performance increase.
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)
Description
Languages
C
98.1%
Shell
0.9%
Makefile
0.5%
Lua
0.2%
Python
0.1%