mirror of
https://github.com/haproxy/haproxy.git
synced 2026-07-16 12:23:15 -04:00
HAProxy - Load balancer
Since 1.8 for simplicity the time offset used to compensate for time drift and jumps had been stored per thread. But with a global time, the complexit has significantly increased. What this patch does in order to address this is to get back to the origins of the pre-thread time drift correction, and keep a single offset between the system's date and the current global date. The thread first verifies from the before_poll date if the time jumped backwards or forward, then either fixes it by computing the new most likely date, or applies the current offset to this latest system date. In the first case, if the date is out of range, the old one is reused with the max_wait offset or not depending on the interrupted flag. Then it compares its date to the global date and updates both so that both remain monotonic and that the local date always reflects the latest known global date. In order to support atomic updates to the offset, it's saved as a ullong which contains both the tv_sec and tv_usec parts in its high and low words. Note that a part of the patch comes from the inlining of the equivalent of tv_add applied to the offset to make sure that signed ints are permitted (otherwise it depends on how timeval is defined). This is significantly more reliable than the previous model as the global time should move in a much smoother way, and not according to what thread last updated it, and the thread-local time should always be very close to the global one. Note that (at least for debugging) a cheap way to measure processing lag would consist in measuring the difference between global_now_ms and now_ms, as long as other threads keep it up-to-date. |
||
|---|---|---|
| .github | ||
| addons | ||
| admin | ||
| contrib | ||
| dev | ||
| doc | ||
| examples | ||
| include | ||
| reg-tests | ||
| scripts | ||
| src | ||
| tests | ||
| .cirrus.yml | ||
| .gitattributes | ||
| .gitignore | ||
| .travis.yml | ||
| BRANCHES | ||
| CHANGELOG | ||
| CONTRIBUTING | ||
| INSTALL | ||
| LICENSE | ||
| MAINTAINERS | ||
| Makefile | ||
| README | ||
| ROADMAP | ||
| 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)