]> git.kaiwu.me - haproxy.git/commit
MINOR: task: maintain a per-thread indicator of the peak run-queue size
authorWilly Tarreau <w@1wt.eu>
Thu, 19 Mar 2026 14:18:32 +0000 (15:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Mar 2026 15:24:31 +0000 (16:24 +0100)
commitb3a84800b4f8246d5c9af62a3a8e2d6d0f6cc76f
tree898c07a372c7df0f1dec7e3bf49c54027971f8c8
parenteec60f14ddbfd77d864d03c8db3f052c74a1f2f9
MINOR: task: maintain a per-thread indicator of the peak run-queue size

The new field th_ctx->rq_tot_peak contains the computed peak run queue
length averaged over the last 512 calls. This is computed when entering
process_runnable_tasks. It will not take into account new tasks that are
created or woken up during this round nor those which are evicted, which
is the reason why we're using a peak measurement to increase chances to
observe transient high values. Tests have shown that 512 samples are good
to provide a relatively smooth average measurement while still fading
away in a matter of milliseconds at high loads. Since this value is
only updated once per round, it cannot be used as a statistic and
shouldn't be exposed, it's only for internal use (self-regulation).
include/haproxy/defaults.h
include/haproxy/tinfo-t.h
src/task.c