Expand description
G28-D: system load average observation (pre-spawn saturation check). G28-D: system load average observation before spawning LLM subprocesses.
The 2026-06-03 incident saturated a 10-CPU host with load 276 because
parallel enrich workers kept spawning claude -p / codex exec
children even when the system was already at saturation. This module
exposes a single helper that returns true when the 1-minute load
average is above 2 × ncpus (the conservative threshold the G28-D
original discussion recommended).
Uses sysinfo::System::load_average() which is already a transitive
dependency of the project. The read is cheap (single syscall on
Linux) and throttled to once per second via a Mutex-cached timestamp.
Functions§
- is_
system_ saturated - G28-D: returns
truewhen the 1-minute load average exceeds2 × ncpus(the conservative threshold originally proposed in the G28 audit). The default threshold can be overridden by theSQLITE_GRAPHRAG_MAX_LOAD_PER_NCPUenv var. - load_
average_ one - Returns the 1-minute load average as reported by the OS.
- ncpus
- Returns the number of logical CPUs the runtime can detect.