Skip to content

[Bug]: "Overloaded" CPU warning fires while most cores are idle when one cgroup is throttled by its own cpu.max #46234

Done

Description

@LuneDevelops

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

Server (resource telemetry), shown in the web sidebar host pressure warning.

Steps to reproduce

  1. On Linux with cgroup v2, run a CPU-heavy build in a cgroup that has a hard CPU cap, for example:
    systemd-run --user --scope -p CPUQuota=600% <a parallel build that wants more than 6 cores>
  2. Leave the rest of the machine mostly idle. In my case it had 32 CPUs.
  3. Wait about a minute.

Expected behavior

No "overloaded" warning. The machine has plenty of free CPU. Only the capped cgroup is waiting, and it waits on its own limit.

Actual behavior

The sidebar shows " is overloaded. Work waits for a free CPU most of the time, so agents and builds run slowly." It lists agents with "Force stop" buttons.

Readings taken while the warning was showing:

  • /proc/pressure/cpu: some avg10=20.38 avg60=59.50 avg300=38.36
  • Host CPU idle over 2 s, from /proc/stat: 78%
  • Load average: 5.12 / 6.46 / 4.95 on 32 CPUs
  • The capped build scope: cpu.max 600000 100000, nr_periods 3254, nr_throttled 2468, and its own cpu.pressure was some avg60=50.80
  • Every other cgroup with cpu.pressure some above 5% was an ancestor of that scope.

The kernel counts tasks held back by a cgroup's cpu.max in the host-wide CPU PSI. One capped cgroup can push /proc/pressure/cpu past the 25% and 60% thresholds while most cores are idle.

Cause

In apps/server/src/resourceTelemetry/HostResources.ts, nextPressureLevels grades CPU from PSI alone when PSI is available:

const cpu =
  sample.cpuSome !== null
    ? grade(previous.cpu, sample.cpuSome, 25, 60)
    : sample.loadPerCpu !== null && sample.cpuIdle !== null
      ? loadLevel(previous.cpu, sample.loadPerCpu, sample.cpuIdle)
      : previous.cpu;

The load-average fallback already requires the CPUs to be nearly all busy (SATURATED_CPU_IDLE). The PSI path has no such check. Also, the sampler computes cpuIdle only when cpuSome is null. The memory grading already handles the same problem: its doc comment says "Host PSI also rises for a cgroup outside T3 stalled at its own limit". CPU has no equivalent guard.

Suggested fix: sample cpuIdle on Linux even when PSI is present, and count CPU PSI as overload only while idle is below SATURATED_CPU_IDLE, with the same hysteresis loadLevel uses. A unit test for nextPressureLevels with cpuSome: 59.5, cpuIdle: 0.78 should return cpu: "none".

Impact

A false alarm that stays up for as long as any capped build or container runs. It tells users to force-stop agents that are not causing the problem. Agents are not throttled by it (the agents slice only has CPUWeight=10), but the warning and the suggested action are misleading.

Version or commit

Logic confirmed unchanged on main at ed2e9d9 (2026-11-30).

Environment

Linux 7.2, cgroup v2 with systemd user scopes, 32 CPUs, desktop server.

Workaround

Dismiss the notice with "Until it clears". It clears about a minute after the capped job ends.

Related

#45672 (host-wide io PSI inside an LXC container) and #44899 (io_uring waits counted as overload) are other cases where host-wide PSI triggers the warning without a real overload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions