Skip to content

fix(chart): uds-csi no CPU limit, GOMAXPROCS=2; keep controller/registrar limits (#1321) - #1327

Merged
bpalermo merged 1 commit into
mainfrom
fix/1321-uds-csi-cpu-limit
Oct 7, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/1321-uds-csi-cpu-limit

Conversation

@bpalermo

@bpalermo bpalermo commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Closes #1321

What

On the 2026-10-06 8 h soak (first with cAdvisor), aether-uds-csi was CFS-throttled in 57.6 % of the periods it ran in (20,248 of 35,169, 15 pods) against a 100m limit, while using 11–23 CPU-seconds per pod over the whole run. It serves NodePublishVolume/NodeUnpublishVolume, on the start and termination path of every UDS pod. Same class as #1253 / #1260 (mesh-dns), same fix:

  • Removes the default CPU limit of the uds-csi DaemonSet (udsCsi.resources).
  • Keeps the 5m CPU request. It is several times the measured average (23 CPU-seconds over 8 h is 0.8m) and it is reserved on every node whether or not a UDS workload runs there. It is small as a CFS weight under contention, but nothing measured so far shows the plugin waiting on a saturated node; the runbook says what to read (cpu.pressure) and when to raise it.
  • Pins GOMAXPROCS=2 through a new udsCsi.goMaxProcs (same shape as agent.goMaxProcs and agent.meshDnsDaemon.goMaxProcs). Go 1.25+ derives GOMAXPROCS from the CPU limit with a floor of 2, so under the old 100m limit the daemon already ran with 2 Ps; without a limit it would scale to the node's cores, and so would the exec liveness probe (/uds-csi --probe, a second Go process in the same container every 30 s, which inherits the env var). 2 keeps today's runtime behaviour exactly. 0/empty omits the env var.
  • Empty limits.cpu renders no limit. uds-csi's template had the bug fix(chart): mesh-dns 50m CPU request, no CPU limit, GOMAXPROCS=2 (#1253) #1260 fixed for mesh-dns (--set udsCsi.resources.limits.cpu= rendered cpu: "", which the apiserver rejects). fix(chart): mesh-dns 50m CPU request, no CPU limit, GOMAXPROCS=2 (#1253) #1260 fixed it inline; this PR moves that block into a shared aether.resources helper in _helpers.tpl and uses it from both DaemonSets. The mesh-dns render is unchanged (its three mesh-dns: CFS-throttled at steady state (25m request / 100m limit) #1253 tests still pass).
  • Memory is unchanged (16Mi/32Mi). This container sets no GOMEMLIMIT; aether.goMemLimit is not touched.
  • QoS: already Burstable, stays Burstable.
  • Chart 2.4.9 -> 2.4.10.

Rendered resources: uds-csi

Before (2.4.9):

resources:
  limits:
    cpu: 100m
    memory: 32Mi
  requests:
    cpu: 5m
    memory: 16Mi
# no GOMAXPROCS env (runtime-derived from the limit: 2)

After (2.4.10):

env:
  - name: GOMAXPROCS
    value: "2"
resources:
  limits:
    memory: 32Mi
  requests:
    cpu: 5m
    memory: 16Mi

Controller and registrar: limits kept (no rendered change)

resources (unchanged) GOMAXPROCS (unchanged) throttled
controller requests 50m/64Mi, limits 100m/64Mi resourceFieldRef: limits.cpu, divisor 1 = 1 1.0 %
registrar requests = limits = 100m/64Mi resourceFieldRef: limits.cpu, divisor 1 = 1 1.5 %

Why they are left alone (also written next to each resources block in values.yaml):

  • Neither is on a request path. A throttled period adds under 100 ms to an admission call the apiserver allows 5 s for (controller), or to an endpoint update on its way to the agents (registrar).
  • The registrar's requests == limits makes it QoS Guaranteed; dropping limits.cpu would demote it to Burstable.
  • Both derive GOMAXPROCS from limits.cpu. With no limit that resourceFieldRef falls back to node allocatable, so removing the limit would also move them from 1 P to one per core; it would need the explicit-pin treatment too.
  • If the throttled fraction grows with fleet size or pod-creation rate, raise the limit (registrar: requests and limits together) before removing it.

Other CPU limits in the charts (reported, not changed)

  • cniInstall.resources: 100m request and limit, on the agent pod's init container. It runs on every agent pod start, and agent: a restart leaves the node's proxy on stale xDS for ~15 s (pod replacement ~9 s + start-to-first-serve ~7 s) #1123 established that an agent pod start is time the node's proxy spends on no ADS stream. Not measured here. Candidate for its own issue.
  • controller.webhook.identityGate.resources.limits.cpu: "" by default, i.e. no CPU limit (the controller drops an empty value; it is passed as a flag, not rendered as a quantity).
  • No CPU limit, verified in the rendered chart: proxy, agent, mesh-dns, the authz sidecar, both edge containers (agent and envoy), and in charts/prober the prober DaemonSet and both authz-canary containers.
  • install-supervisor (proxy pod init container) renders no resources at all.
  • Side note, not a limit: the edge agent container has no CPU limit and no GOMAXPROCS pin, so its Go runtime sizes to the node's cores.

Tests

New in charts/aether/BUILD.bazel:

  • aether_uds_csi_cpu_resources_test: default has no cpu limit, request 5m, GOMAXPROCS "2". Red against origin/main's chart, green after.
  • aether_uds_csi_empty_cpu_limit_test: --set udsCsi.resources.limits.cpu= renders no cpu limit. Red before (it rendered cpu: ""), green after.
  • aether_uds_csi_cpu_limit_override_test: --set udsCsi.resources.limits.cpu=200m still caps it.
  • aether_uds_csi_gomaxprocs_off_test: udsCsi.goMaxProcs=0 renders no GOMAXPROCS.

Run locally:

  • bazel test //charts/... //agent/cmd/uds-csi/... //agent/internal/proxy/hotrestart:hotrestart_test: 87/87 pass.
  • bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...: clean.
  • make format-check: rc 0.

Docs: docs/configuration.md rows for udsCsi.resources, udsCsi.goMaxProcs, and the kept controller/registrar limits. docs/runbook.md gets uds-csi CPU throttling (and the controller's and registrar's CPU limits) right after the mesh-dns section.

Post-deploy measurement (talos, cAdvisor)

Before (current release), per container over the soak window:

sum by (container) (increase(container_cpu_cfs_throttled_periods_total{namespace="aether-system", container!=""}[8h]))
  / sum by (container) (increase(container_cpu_cfs_periods_total{namespace="aether-system", container!=""}[8h]))

After 2.4.10: a container with no quota has no container_cpu_cfs_* series at all, so uds-csi drops out of that result instead of reading 0. Treat "no data" as the pass only together with these two:

# Expect: empty (any series = a uds-csi container that still has a quota)
count by (pod) (container_cpu_cfs_periods_total{namespace="aether-system", container="uds-csi"})

# Expect: one series per pod (proves the scrape is alive); millicores used
1000 * sum by (pod) (rate(container_cpu_usage_seconds_total{namespace="aether-system", container="uds-csi"}[30m]))

Controller and registrar stay in the first query; that is where to watch whether 1.0 % / 1.5 % holds.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…trar limits (#1321)

uds-csi was CFS-throttled in 57.6 % of its active periods on the
2026-10-06 soak (20,248 of 35,169 over 8 h, 15 pods) against a 100m
limit while using 11-23 CPU-seconds per pod. It serves
NodePublish/NodeUnpublish, on the pod-start path of every UDS pod.

- udsCsi.resources: drop the default CPU limit; the 5m request and the
  memory request/limit are unchanged.
- udsCsi.goMaxProcs: 2, rendered as GOMAXPROCS (what the Go runtime
  derived from the old 100m limit); 0/empty omits it.
- aether.resources helper: an empty/null quantity is dropped instead of
  rendered as `cpu: ""`. Extracted from mesh-dns' inline block (#1253)
  and used by both DaemonSets.
- controller (1.0 %) and registrar (1.5 %) keep their CPU limits; the
  reasons are written next to their resources in values.yaml.
- Chart 2.4.9 -> 2.4.10; helm_template_tests; configuration.md rows and
  a runbook section with the cAdvisor queries.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
Copilot AI balanced review requested due to automatic review settings October 7, 2026 01:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation, compatibility behavior, tests, and documentation consistently address the reported throttling.

Review effort: Balanced
Findings: None

What changed in this PR

Removes uds-csi’s CPU limit to prevent CFS throttling while preserving controlled Go concurrency.

Changes:

  • Pins uds-csi GOMAXPROCS=2 and retains its 5m CPU request.
  • Adds a shared resource-rendering helper that omits empty quantities.
  • Adds Helm tests, operational guidance, and bumps the chart to 2.4.10.
File Description
charts/​aether/​Chart.yaml Bumps chart version.
charts/​aether/​values.yaml Updates uds-csi defaults and resource rationale.
charts/​aether/​templates/​_helpers.tpl Adds shared resource filtering.
charts/​aether/​templates/​uds-csi-daemonset.yaml Renders GOMAXPROCS and filtered resources.
charts/​aether/​templates/​mesh-dns-daemonset.yaml Adopts the shared helper.
charts/​aether/​BUILD.bazel Tests resource and GOMAXPROCS rendering.
docs/​configuration.md Documents configuration defaults.
docs/​runbook.md Adds throttling diagnostics and remediation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bpalermo
bpalermo merged commit cd4c3df into main Oct 7, 2026
31 checks passed
@bpalermo
bpalermo deleted the fix/1321-uds-csi-cpu-limit branch October 7, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uds-csi: CFS-throttled in 57.6 % of its active periods (100m CPU limit); controller and registrar throttled too

2 participants