mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
HAProxy - Load balancer
Right now when dealing with freq_ctr updates, we're using the process- wide monotinic time, and accessing it is expensive since every thread needs to update it, so this adds some contention. However we don't need it all the time, the thread's local time is most of the time strictly equal to the global time, and may be off by one millisecond when the global time is switched to the next one by another thread, and in this case we don't want to use the local time because it would risk to cause a rotation of the counter. But that's precisely the condition we're already relying on for the slow path! What this patch does is to add a check for the period against the local time prior to anything else, and immediately return after updating the counter if still within the period, otherwise fall back to the existing code. Given that the function starts to inflate a bit, it was split between s very short inline part that does the hot path, and the slower fallback that's in a cold function. It was measured that on a 24-CPU machine it was called ~0.003% of the time. The resulting improvement sits between 2 and 3% at 500k req/s tracking an http_req_rate counter. |
||
|---|---|---|
| .github | ||
| addons | ||
| admin | ||
| dev | ||
| doc | ||
| examples | ||
| include | ||
| reg-tests | ||
| scripts | ||
| src | ||
| tests | ||
| .cirrus.yml | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| .travis.yml | ||
| BRANCHES | ||
| CHANGELOG | ||
| CONTRIBUTING | ||
| INSTALL | ||
| LICENSE | ||
| MAINTAINERS | ||
| Makefile | ||
| README | ||
| 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 - 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)