mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-13 05:49:17 +02:00
d9464167fa3185c2df42d123cd789ac07cc8cb96
This partially reverts commitd846c267("MINOR: h2: Don't run tasks that are waiting to send if mux in full"). This commit was introduced to limit the start/stop overhead incurred by waking many streams to let only a few work. But since commit9c218e7521("MAJOR: mux-h2: switch to next mux buffer on buffer full condition."), this situation occurs way less (typically 2000 to 4000 times less often) and the benefits of the patch above do not outweigh its shortcomings anymore. And commitc7ce4e3e7f("BUG/MEDIUM: mux-h2: don't stop sending when crossing a buffer boundary") addressed a root cause of many unexpected sleeps and wakeups. The main problem it's causing is that it requires to keep the element in the send_wait list until it's executed, leaving the entry in an uncertain state, and significantly complicating the coexistence of this list and the wait list dedicated to shutdown. Also it happens that this call to tasklet_remove_from_task_list() will not be usable anymore once we start to support streams on different threads. And finally, some of the other streams that we remove might very well have managed to find their way to the h2_snd_buf() with an unblocked condition as well so it is possible that some of these removals were not welcome. So this patch now makes sure that send_wait is immediately nulled when the task is woken up, and that we don't have to play with it afterwards. Since we don't need to stop the tasklets anymore, we don't need the sending_list that we can remove. However one very useful benefit of the sending_list was that it used to provide the information about the fact that the stream already tried to send and failed. This was an important factor to improve fairness because late arrived streams should not be allowed to send if others are already scheduled. So this patch introduces a new per-stream flag H2_SF_NOTIFIED to distinguish such streams. With this patch the fairness is preserved, and the ratio of aborted h2_snd_buf() due to other streams already sending remains quite low (~0.3-2.1% measured depending on object size, this is within expectations for 100 independent streams). If the contention issue the patch above used to address comes up again in the future, a much better (though more complicated) solution would be to switch to per-connection buffer pools to distribute between the connection and the streams so that by default there are more buffers available for the mux and the streams only have some when the mux's are unused, i.e. it would push the memory pressure back to the data layer. One observation made while developing this patch is that when dealing with large objects we still spend a huge amount of time scanning the send_list with tasks that are already woken up every time a send() manages to purge a bit more data. Indeed, by removing the elements from the list when H2_SF_NOTIFIED is set, the netowrk bandwidth on 1 MB objects fetched over 100 streams per connection increases by 38%. This was not done here to preserve fairness but is worth studying (e.g. by keeping a restart pointer on the list or just having a flag indicating if an entry was added since last scan).
…
…
…
…
…
…
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
haproxy public development tree. Unstable code.
cachecachingddos-mitigationfastcgihaproxyhigh-availabilityhigh-performancehttphttp2httpsipv6load-balancerproxyproxy-protocolreverse-proxytls13
Readme
252 MiB
Languages
C
98%
Shell
0.9%
Makefile
0.5%
Lua
0.2%
Python
0.2%