Repository navigation
Description
Problem
The aether-mesh-dns daemon's readiness probe (added #580, tuned #581) execs /agent mesh-dns --readiness-check, which re-runs the full /agent binary every periodSeconds (5s) to stat a pod-local marker. The binary is the whole agent (controller-runtime, xDS, …), so each cold start burns ~150–200ms of CPU.
Measured (talos rev 180 / chart 0.85.0, live)
- mesh-dns daemon: ~46–56m CPU, 12–15Mi RSS per node.
- The ~50m CPU is almost entirely the probe re-exec, not DNS serving (a
<svc>.<ns>map lookup at mesh QPS is microseconds). Math: ~180ms cold-start × (1/5s) ≈ ~36–40m avg — matches. - Across the 5-node fleet that's ~250m CPU spent health-checking, and it's why fix(mesh-dns): readiness probe timeout + CPU headroom (unblock surge rollout) #581 had to inflate limits to
cpu 300m / mem 128Mi(burst headroom for the transient second/agentprocess).
Proposal
Replace the exec probe with an in-process HTTP /healthz served by the daemon on a plain 127.0.0.1:<port> listener (NOT :18054, NOT SO_REUSEPORT), returning 200 once both DNS listeners are bound (i.e. where the ready-marker is written today). Switch the DaemonSet to an httpGet readiness probe.
- Zero re-exec → CPU drops from ~50m to single-digit m; limits can come back down toward the daemon's real footprint (~15Mi / few m).
- No REUSEPORT false-ready ambiguity — the reason a
tcpSocketprobe on:18054was rejected (kubelet could hit the peer pod's co-bound socket during a surge). A dedicated non-REUSEPORT localhost health port is pod-local, so it proves this process is serving. Keep the surge/readiness guarantee from feat(mesh-dns): readiness gate so surge rolls are hitless #580.
Scope
agent/internal/meshdns(or themesh-dnssubcommand): start a tiny HTTP health listener on127.0.0.1:<healthPort>; return 200 afterbuildServersbinds (reuse the same signal as the current ready-marker; the marker/--readiness-checkpath can be removed).charts/aether/templates/mesh-dns-daemonset.yaml:httpGetreadiness probe on the health port; drop theemptyDirmarker volume; lowermeshDnsDaemon.resources(the re-exec headroom is no longer needed). Chart version bump.- Keep the ready-after-bind semantics so
maxSurge:1still waits for a true bind (the feat(mesh-dns): readiness gate so surge rolls are hitless #580 guarantee).
Context
Follows #578 (decouple), #580 (readiness gate), #581 (probe timeout+CPU headroom). Surfaced while assessing a Go→Rust rewrite of the resolver (rejected — footprint is already tiny; the only real cost was this probe). Complements the slim-binary follow-up (separate issue).
Activity
bpalermo commentedon Jul 24, 2026
Reframing — the in-process httpGet approach is unsafe here; the CPU goal is being met via #583 instead
While implementing, the proposed in-process
/healthz+httpGetprobe turned out to be unsafe on this host-network +maxSurge:1DaemonSet: during a surge the old and new pods share the host network namespace, so any health port eithertcpSocketto avoid.A port-based check can't be provably pod-local on host-network+surge, so switching to httpGet would regress the #580 readiness guarantee.
Root cause of the ~50m/node (~250m fleet) CPU is not the probe mechanism — it's re-execing the full
/agentbinary (~180ms cold-start) every 5s. #583 (slim/mesh-dnsbinary) makes that same pod-local marker check cheap (~10–20ms cold-start), reclaiming the CPU without the correctness regression. The implementing PR also bumpsperiodSeconds5→15 to further cut churn and lowersmeshDnsDaemon.resources.Closing as resolved-by-#583 (the httpGet mechanism is abandoned; the CPU-reclaim goal is delivered there).
feat(mesh-dns): slim standalone binary for the daemon (#583) (#584)
perf(proxy): replace the readiness probe's 67MB agent re-exec with a …
perf(mesh-dns): stdlib-only readiness prober, and --debug off by defa…