mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-02-08 10:51:06 +01:00
During 1.9 development cycle a shortcut was made in process_stream() to update the analysers immediately after an I/O even detected on the send() path while leaving the function. In order to prevent this from being abused by a single stream stealing all the CPU, the loop didn't cover the initial recv() call, so that events ultimately converge. This has caused a number of issues over time because the conditions to decide to loop are a bit tricky. For example the CF_READ_PARTIAL flag is not immediately removed from rqf_last and may appear for a long time at this point, sometimes causing some loops to last long. Another unexpected side effect is that all analysers are called again with no data to process, just because CF_WRITE_PARTIAL is present. We cannot get rid of this event even if of very rare use, because some analysers might wait for some data to leave a buffer before proceeding. With a full loop, this event would have been merged with a subsequent recv() allowing analysers to do something more useful than just ack an event they don't care about. While during early 1.9-dev it was very important to be kind with the scheduler, nowadays it's lock-free for local tasks so this optimization is much less interesting to use it for I/Os, especially if we factor in the trouble it causes. This patch thus removes the use of the loop for regular I/Os and instead performs a task_wakeup() with an I/O event so that the task will be scheduled after all other ones and will have a chance to perform another recv() and possibly to gather more I/O events to be processed at once. Synchronous errors and transitions to SI_ST_DIS however are still handled by the loop. Doing so significantly reduces the average number of calls to analysers (those are typically halved when compression is enabled in legacy mode), and as a side benefit, has increased the H1 performance by about 1%.
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)
Description
Languages
C
98.1%
Shell
0.9%
Makefile
0.5%
Lua
0.2%
Python
0.1%