Skip to content

fix(chart): the node agent keeps its 200m CPU request, drops its CPU limit, and pins GOMAXPROCS=2 (#1116) - #1119

Merged
bpalermo merged 1 commit into
mainfrom
fix/1116-agent-cpu-limit
Oct 1, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/1116-agent-cpu-limit

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Closes #1116

What

  • agent.resources default: requests: {cpu: 200m, memory: 64Mi}, limits: {memory: 64Mi}; no limits.cpu. Memory request = limit is unchanged.
  • New value agent.goMaxProcs (default 2) is rendered as the agent container's GOMAXPROCS env var. If it is 0 or empty, the env var is left out and the Go runtime chooses.
  • The agent DaemonSet already set GOMAXPROCS through resourceFieldRef: limits.cpu, which rounded 200m up to 1. That entry is replaced rather than duplicated. Once the limit is gone, the downward API would fall back to node allocatable, the same as Go ≥ 1.25's own cgroup derivation would. Controller and registrar keep their resourceFieldRef GOMAXPROCS and their resources; this PR changes neither.
  • Chart 2.1.1 → 2.1.2.

Why

Snapshot builds are 5–25 ms CPU bursts on the ODCDS/EDS path. A 200m CFS quota allows 20 ms of CPU per 100 ms period, so those builds became 100 ms steps, and a goroutine could be throttled while holding the snapshot-cache mutex (#1105/#1114).

Trade-off: the agent pod becomes QoS Burstable instead of Guaranteed. An operator who needs Guaranteed sets limits.cpu equal to requests.cpu and raises both to at least 1000m. Pairing that with agent.goMaxProcs=0 lets the runtime follow the limit again.

Effective GOMAXPROCS goes from 1 (the ceil of 200m) to 2.

Tests

  • aether_agent_cpu_resources_test: checks the agent container's resources by position. limits holds only memory and requests.cpu: 200m, followed by volumes:, so the cni-install initContainer cannot satisfy it. It also checks GOMAXPROCS value: "2". Red on main's chart (both patterns missing), green here.
  • aether_agent_gomaxprocs_off_test (helm_template_absent_test): with agent.goMaxProcs=0, agent-daemonset.yaml renders no name: GOMAXPROCS. The control string is name: GOMEMLIMIT.
  • bazel test //charts/aether:all: 45/45 pass. make format is clean, and bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //... passes.

Docs

docs/configuration.md covers the agent.resources row (Burstable, the ≥1000m guidance) and the new agent.goMaxProcs row. docs/runbook.md never says the agent is Guaranteed or has a 200m limit, so it is unchanged.

After deploy (talos)

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…limit, and pins GOMAXPROCS=2 (#1116)

Snapshot builds are 5-25 ms CPU bursts on the ODCDS/EDS path. Under a 200m
CFS quota they became 100 ms steps and a goroutine could be throttled while
holding the snapshot-cache mutex (#1105/#1114). The agent pod is now
Burstable rather than Guaranteed; an operator who needs Guaranteed sets
limits.cpu = requests.cpu >= 1000m.

GOMAXPROCS was derived from limits.cpu via resourceFieldRef, which falls back
to node allocatable once the limit is gone (and the Go >= 1.25 runtime would
likewise scale to the node's cores). It is now an explicit env from the new
agent.goMaxProcs value (default 2); 0/empty omits it.

Chart 2.1.1 -> 2.1.2.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit 0bf0cec into main Oct 1, 2026
24 checks passed
@bpalermo
bpalermo deleted the fix/1116-agent-cpu-limit branch October 1, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant