mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-15 15:32:16 +02:00
88718955f4cef87fcf656b451c7b301ff968938d
Before muxes were used, we used to refrain from reading past the buffer's reserve. But with muxes which have their own buffer, this rule was a bit forgotten, resulting in an extraneous read to be performed just because the rx buffer cannot be entirely transferred to the stream layer: sendto(12, "GET /?s=16k HTTP/1.1\r\nhost: 127."..., 84, MSG_DONTWAIT|MSG_NOSIGNAL, NULL, 0) = 84 recvfrom(12, "HTTP/1.1 200\r\nContent-length: 16"..., 16320, 0, NULL, NULL) = 16320 recvfrom(12, ".123456789.12345", 16, 0, NULL, NULL) = 16 recvfrom(12, "6789.123456789.12345678\n.1234567"..., 15244, 0, NULL, NULL) = 182 recvfrom(12, 0x1e5d5d6, 15062, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable) Here the server sends 16kB of payload after a headers block, the mux reads 16320 into the ibuf, and the stream layer consumes 15360 from the first h1_rcv_buf(), which leaves 960 into the buffer and releases a few indexes. The buffer cannot be realigned due to these remaining data, and a subsequent read is made on 16 bytes, then again on 182 bytes. By avoiding to read too much on the first call, we can avoid needlessly filling this buffer: recvfrom(12, "HTTP/1.1 200\r\nContent-length: 16"..., 15360, 0, NULL, NULL) = 15360 recvfrom(12, "456789.123456789.123456789.12345"..., 16220, 0, NULL, NULL) = 1158 recvfrom(12, 0x1d52a3a, 15062, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable) This is much more efficient and uses less RAM since the first buffer that was emptied can now be released. Note that a further improvement (tested) consists in reading even less (typically 1kB) so that most of the data are transferred in zero-copy, and are not read until process_stream() is scheduled. This patch doesn't do that for now so that it can be backported without any obscure impact.
…
…
…
…
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
254 MiB
Languages
C
98%
Shell
0.9%
Makefile
0.5%
Lua
0.2%
Python
0.2%