Repository navigation
Description
Summary
First eBPF continuous-profiling data from talos-main (2026-08-30, 2h window) shows the proxy-supervisor's steady-state CPU is dominated by its admin watchdog: (*Supervisor).Run → adminProbe accounts for ~40–45% of the supervisor's total CPU, and most of that is encoding/json decode work. The absolute cost is small (~0.8% of a core per node, ~282s CPU per 2h fleet-wide) but it is a constant, per-second background load on every node plus one admin HTTP request per second against each Envoy, forever.
Mechanism
agent/internal/proxy/hotrestart/coordination.go:
- The watchdog loop ticks every
readyPollInterval = 1s(coordination.go:161) and callsadminProbe(coordination.go:293). adminProbeGETs/server_infoand runsjson.NewDecoder(resp.Body).Decode(&info)into a struct needing exactly two fields (state,command_line_options.restart_epoch)./server_infois a large payload (the fullcommand_line_optionsobject among others), and the decoder parses/skips all of it — the profile showsdecodeState.value/skipas the hot frames.- The agent-side profile also shows
http.(*Transport).dialConn(~8%), consistent with the probes not reusing connections (worth verifying whether the admin closes per-request).
Why touch it
Not because of the milli-cores — because the watchdog only needs a boolean pair (live-at-epoch, reachable) and pays for a full JSON parse of an unbounded document once a second on every node, and the same poll is a standing 1 rps load on each Envoy admin (the same admin whose unresponsiveness the watchdog is trying to detect; cheaper probes also reduce false-positive exposure under load). The 007/admin-probe-elimination work removed all agent→admin calls; the supervisor is the deliberate exception, so it should at least be as cheap as possible.
Options (cheapest first)
- Steady-state probe via
/ready— plain-textLIVE\n, no JSON at all. Epoch verification (/server_info) is only needed while a handoff is in flight (initStartEpoch/ waiting-for-LIVE-at-epoch); once the epoch is confirmed LIVE, the per-second watchdog only needs reachability + liveness, which/readyanswers. Re-probe/server_infoonly when a new epoch launches. - Decode the two fields without parsing the rest (json.Decoder token walk), if
/server_infomust stay. - Optionally relax the steady-state interval (1s → 2–5s) — the admin-unresponsive deadline is much larger anyway.
Option 1 + keeping the 1s cadence preserves current detection latency at near-zero cost.
Evidence
- Pyroscope
process_cpu,service_name="unknown_service:supervisor", 2026-08-30 16:58–18:58Z: 282.4s total;Supervisor.Run→adminProbe51.35s+66.40s paths withjson.(*Decoder).Decode32.25s,decodeState.value25.15s,decodeState.skip10.90s. - Zero supervisor/proxy restarts in the window (fleet stable; this is pure steady-state cost).
Activity
fix(supervisor): derive the admin re-verify interval from the effecti…