mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
Some users are facing huge CPU usage or even watchdog panics due to the Lua global lock when many threads compete on it, but they have no way to see that in the usual dumps. We take the lock at 2 or 3 places only, thus it's trivial to move it to a global function so that stack dumps will now explicitly show it, increasing the change that it rings a bell and someone suggests switch to lua-load-per-thread: Current executing Lua from a stream analyser -- stack traceback: loop.lua:1: in function line 1 call trace(27): | 0x5ff157 [48 83 c4 10 5b 5d 41 5c]: wdt_handler+0xf7/0x104 | 0x7fe37fe82690 [48 c7 c0 0f 00 00 00 0f]: libpthread:+0x13690 | 0x614340 [66 48 0f 7e c9 48 01 c2]: main+0x1e8a40 | 0x607b85 [48 83 c4 08 48 89 df 31]: main+0x1dc285 | 0x6070bc [48 8b 44 24 20 48 8b 14]: main+0x1db7bc | 0x607d37 [41 89 c4 89 44 24 1c 83]: lua_resume+0xc7/0x214 | 0x464ad6 [83 f8 06 0f 87 f1 01 00]: main+0x391d6 | 0x4691a7 [83 f8 06 0f 87 03 20 fc]: main+0x3d8a7 | 0x51dacb [85 c0 74 61 48 8b 5d 20]: sample_process+0x4b/0xf7 | 0x51e55c [48 85 c0 74 3f 64 48 63]: sample_fetch_as_type+0x3c/0x9b | 0x525613 [48 89 c6 48 85 c0 0f 84]: sess_build_logline+0x2443/0x3cae | 0x4af0be [4c 63 e8 4c 03 6d 10 4c]: http_apply_redirect_rule+0xbfe/0xdf8 | 0x4af523 [83 f8 01 19 c0 83 e0 03]: main+0x83c23 | 0x4b2326 [83 f8 07 0f 87 99 00 00]: http_process_req_common+0xf6/0x15f6 | 0x4d5b30 [85 c0 0f 85 9f f5 ff ff]: process_stream+0x2010/0x4e18 It also allows "perf top" to directly show the time spent on this lock. This may be backported to some stable versions as it improves the overall debuggability.
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
Languages
C
98.1%
Shell
0.8%
Makefile
0.5%
Lua
0.2%
Python
0.2%