Skip to content

soak: QUIC twins cost the proxy fleet +33% CPU and ~+20% RSS under identical load (rev242 vs rev239); attribute before dropping the allow-list #1006

Closed

Description

@bpalermo

Finding

The proving QUIC soak (2026-09-27, talos rev242 / chart 0.95.3-cb79180, svc-1/svc-2 allow-listed, otherwise the same k6 load, churn schedule and prober as the rev239 run) cost the proxy fleet +0.71 cores (+33 %) and ~+20 % RSS against rev239 (0.94.0, no QUIC) under identical load.

rev239 (no QUIC) rev242 (QUIC on svc-1/svc-2)
aether-proxy process_cpu, fleet, 10:30–17:30Z (Pyroscope, hourly points end-labelled) 2.165 cores 2.879 cores
RSS at 30 min age, n=30 74–102 Mi 100–131 Mi, median 120 Mi
RSS at 2.6 h age 82–101 Mi 105–139 Mi

Only two of the four k6 targets rode QUIC (svc-1/svc-2 ≈ 2.88 M of the 5.76 M k6 requests), so the per-request cost of HTTP/3 vs h2 is worse than the fleet ratio suggests.

Why it gates the flag drop (#979)

Two things are entangled and must be attributed before east-west QUIC goes unconditional:

  1. The twins. A quic: twin cluster is built for every local ServiceAccount × allow-listed destination (5,960 @ series fleet-wide in this run), not just the identities that actually dial the destination. Unconditional QUIC multiplies the twin count by roughly the number of mesh services per node. That is a fixed per-cluster cost (health checks, stats, SDS, TLS contexts) paid regardless of traffic.
  2. HTTP/3 per-request cost (userspace QUIC + TLS 1.3 per packet, no kernel offload) paid only on traffic that moves.

Neither is separable from the fleet number above.

Ask

  • A rev242-vs-rev239 flamegraph diff on aether-proxy (Pyroscope has both), splitting the delta between the quic: cluster fixed cost and the HTTP/3 request path.
  • If the twin fixed cost dominates: build twins only for identities that have actually dialled the destination (demand-scoped, the way Refactor agent #4 scopes CDS) before dropping the allow-list.
  • Record the QUIC baseline for the next soak: compare proxy CPU to 2.88 cores, not 2.16.

Grader record: project_soak_20260927_rev242_run (session memory). Related: #979 (flag drop, held), #846.

Activity

  1. added
    enhancement
    on Sep 27, 2026
  2. bpalermo commented on Sep 27, 2026

    @bpalermo
    OwnerAuthor

    Attribution: the fixed cost of the twins is about zero. The HTTP/3 request path is nearly all of the +0.78 cores.

    Headline. At matched load, the idle quic: twins cost ≈ 0 CPU: ≤ 0.02 cores, and all three measurements put it at 0.00–0.003. Their cost is memory, about 220 KiB of heap per twin, plus about 52 stat series each. Almost all of the CPU delta, and about 80 % of the heap delta, is traffic-driven: HTTP/3 costs about 3× an h2 mesh request at this workload (+≈7.8 ms of proxy CPU for each QUIC request, counting both ends). Demand-scoping the twins is still worth doing, for memory, stats, CDS size and #1008, but it will not recover the CPU. The CPU is in the request path.

    Method and windows

    • Windows. Both are the T0-matched no-roll 80 min window, with the same churn offset (T0 + 6h05m → T0 + 7h25m) and no proxy, agent or service roll inside it:
      • rev239: 2026-09-26 19:20:42–20:40:42Z
      • rev242: 2026-09-27 16:00–17:20Z
    • Load was identical. increase(envoy_cluster_upstream_rq_total)/4800 per mesh destination: echo 100.1 / 99.9, mixed-svc 50.8 / 50.8, svc-1..4 49.9–50.1 each in both runs. In rev242, svc-1 and svc-2 ran entirely on …@aether-test/default (50.0 / 50.1 rps), so QUIC carried 100 of the 350 mesh rps (28.6 %). Fleet upstream rq total was 853 vs 863 rps (+1.2 %).
    • CPU source. Pyroscope process_cpu, service_name="aether-proxy", split by process_executable_name. Points are end-labelled, and the first point of each window is dropped. Profiles are pprof graphs (format=dot, top 260 of 10.7k / 14.0k nodes, 93.5 % / 93.6 % of samples shown).

    1. Fleet cores and the split

    rev239 (no QUIC) rev242 (QUIC svc-1/2) Δ
    aether-proxy, all processes 2.168 2.912 +0.745 (+34 %)
    envoy 2.092 2.872 +0.780 (+37 %)
    supervisor 0.073 0.037 −0.036 (not QUIC; noted only because it offsets the total)
    opa + runc + proxy-ready 0.004 0.004 0

    The 7 h figures in the issue (2.165 / 2.879) reproduce within 1 % in this narrower, cleaner window.

    envoy Δ +0.780 cores attributed to cores share evidence
    (A) fixed cost of the twins (118 fleet-wide) ≈ 0.00–0.003, bounded ≤ 0.02 ≤ 3 % (a) idle test: envoy was 0.923 cores idle on rev239 with 472 clusters (09-26 21:40–22:15Z) and 0.911 idle on rev240 with 580 clusters (+108 idle twins, 09-27 00:00–06:00Z, 0 rps on any @ cluster). Background traffic was the same (149 vs 147 upstream rps), so the result is −0.012 ± noise. (b) main thread (Server::InstanceBase::run, where CDS, stats flush, outlier timers and HC scheduling run): 0.0395 → 0.0426, +0.003. (c) active HC (HealthCheckerImplBase::ActiveHealthCheckSession timer): 0.0084 → 0.0088, +0.0004.
    (B) HTTP/3 request path ≈ 0.76–0.78 ≈ 97 % by elimination: A ≈ 0, load matched to ±1.2 %, and the idle test also bounds the build change (below). Directly QUIC-tagged frames are broken out below.
    unattributed: Envoy build change (0.94.0 → 0.95.3 carries the Envoy pin bump; the absl namespace moves lts_20260107 → lts_20260817) not separable at load; ≈ 0 at idle — No run exists on the new Envoy under load without QUIC. At idle, with the same ~150 rps background traffic, the build moved envoy by −1.3 %.

    What (B) is made of (cumulative cores; frames with no rev239 counterpart marked "new"; the rows overlap, so they do not sum):

    frame rev239 rev242 Δ
    EnvoyQuicClientConnection::setUpConnectionSocket read-event lambda (source side, reads + processPacket) new 0.065 +0.065
    UdpListenerImpl::handleReadCallback (destination-side QUIC listener) new 0.034 +0.034
    quic::QuicConnection::OnAckAlarm new 0.021 +0.021
    Http1::ConnectionImpl::dispatch: QUIC writes inline from the H1 side (h2 defers them to onWriteReady) 0.035 0.116 +0.081
    quic::QuicConnection::ScopedPacketFlusher::~ (two sites) new 0.089 + 0.035 +0.12
    kernel udp_sendmsg (QUIC TX; below the 0.0015 cutoff in rev239) ≈0 0.108 +0.108
    kernel RX softirq __netif_receive_skb 0.142 0.202 +0.060
    nf_hook_slow / vxlan_xmit / do_epoll_wait / schedule 0.100 / 0.033 / 0.059 / 0.049 0.136 / 0.045 / 0.076 / 0.065 +0.037 / +0.012 / +0.017 / +0.016
    TCP side, for contrast: tcp_sendmsg / ConnectionImpl::onWriteReady / Http2::ConnectionImpl::dispatch / bssl do_tls_write 0.282 / 0.318 / 0.042 / 0.121 0.288 / 0.324 / 0.041 / 0.100 +0.006 / +0.006 / 0.000 / −0.021
    • Tagged lower bound. The four disjoint user-space QUIC entry points (client socket events + listener reads + ACK alarm + inline H1-side writes) add up to 0.201 cores. The rest of B shows up in generic kernel and scheduler frames: RX softirq, bridge/netfilter/vxlan, epoll/scheduler wakeups, get_random_u16. Stack-depth truncation also hides part of it (see "Not measured").
    • Why a request costs this much. Each request is tiny (92 B in, 903 B out on svc-3/4). 128 QUIC connections carry 100 rps, about 0.8 rps per connection. The h2 side has the same 128 connections for svc-3/4 and 0 new connections in the window on either side, so this is not handshake churn. Every request is therefore its own flight: userspace ACK processing, ACK and packet-flush alarms, and an extra UDP datagram each way. There is no kernel delayed-ACK, TSO or GRO help. The profile agrees: UDP TX, RX softirq and scheduler/epoll wakeups grew, while TLS-over-TCP writes fell by about the 29 % share that moved off TCP.

    Per-request CPU. Loaded minus idle on rev239 is 1.169 cores over 350 mesh rps, so ≈ 3.3 ms of proxy CPU per h2 mesh request (both proxies, all three legs). QUIC adds ≈ 0.78 cores over 100 rps, so +≈ 7.8 ms. An h3 request therefore costs ≈ 11 ms, about 3.3× an h2 request. These are loaded-minus-idle estimates, not a per-request profile.

    2. Top 10 self-time growers (flat core-s per 80 min, rev239 → rev242)

    # function rev239 rev242 Δ core-s Δ cores
    1 sched_balance_update_blocked_averages 218.45 297.05 +78.6 +0.0164
    2 finish_task_switch 199.85 268.10 +68.3 +0.0142
    3 local_daif_restore (IRQ re-enable on arm64) 62.05 90.30 +28.3 +0.0059
    4 __ip_append_data (UDP TX, new) — 12.30 +12.3 +0.0026
    5 get_random_u16 14.20 25.05 +10.9 +0.0023
    6 __dev_queue_xmit 25.40 36.20 +10.8 +0.0023
    7 udp_sendmsg (new) — 10.30 +10.3 +0.0021
    8 __netif_receive_skb_core 24.65 34.70 +10.1 +0.0021
    9 udp_recvmsg (new) — 8.65 +8.7 +0.0018
    10 vxlan_xmit_one / nf_hook_slow / ep_try_send_events 13.0 / 18.3 / 18.9 20.55 / 25.8 / 26.0 +7.6 / +7.5 / +7.1 +0.0016 each

    The growth is diffuse. These ten account for ≈ 0.06 of the 0.78 cores; the rest is spread across more than 13k functions. The scheduler and wakeup frames are at the top, which fits the "many small flights" mechanism. No cluster-manager, ClusterImplBase, Stats:: or SDS frame grew enough to appear. User-space leaf functions (AES-GCM, QPACK, memcpy) are not individually visible at this node budget; see "Not measured".

    3. Metric cross-checks

    • Twin count. envoy_cluster_manager_active_clusters (proxy fleet, excluding edge) went from 502 to 620 (+118). Distinct @ clusters per node: w01 28, w02 22, w03 18, w04 28, w05 22 = 118 = 2 × local SAs (14/11/9/14/11). There are 6,162 @ series, about 52 per twin. Only 2 of the 118 twins (…@aether-test/default) had any connection or request.

    • Health checks. envoy_cluster_health_check_* is not in Prometheus (no series in either run), so the HC rate cannot be split @ vs non-@ from metrics. From the code instead: QUICClusterFrom (agent/internal/xds/proxy/egress.go:184) clones the EDS service cluster from NewServiceCluster, which has no active health_checks. Only the per-pod health_<pod> and inboundready_<pod> clusters have them (proxy/cluster.go:429, :526). So twins have no health checks to remove. The profile's HC session frame is flat (+0.0004 cores), which confirms it.

    • Heap (envoy_server_memory_allocated, fleet sum; no cadvisor/RSS series here):

      idle loaded
      no twins (rev239) 149.7 MiB (472 clusters) 243.3 MiB
      twins (rev240 idle / rev242 loaded) 173.3 MiB (580 clusters) 353.7 MiB (+110.4, +45 %)
      • (A) memory: +23.6 MiB for 108 idle twins = ≈ 223 KiB per twin, and consistent per node (162–290 KiB). That is about 26 MiB at 118 twins. It fits each twin carrying its own QUIC client TLS context plus per-worker cluster state.
      • (B) memory: traffic-driven growth was +93.6 MiB without QUIC and +180.5 MiB with it, so +87 MiB comes from 128 client + 128 server QUIC connections, ≈ 340 KiB per QUIC connection end.
      • Split of the +110 MiB heap delta: ≈ 23 % A, ≈ 77 % B. The ~+20 % RSS in the issue is this, diluted by non-heap RSS.
    • Stats-flush cost is not separable. It runs on the main thread, and the whole main thread moved +0.003 cores.

    • Request rates. rate(envoy_cluster_upstream_rq_total{aether_cluster=~".*@.*"}) averaged 100.1 rps in the window (twins only). It was 0 overnight, while the twins existed but carried nothing, which is what makes the idle test clean.

    4. Projection for unconditional QUIC (dropping the allow-list, #979)

    • N (local SAs per node) = 14/11/9/14/11, 59 fleet-wide.
    • M (QUIC-eligible HTTP mesh destinations) ≈ 11: svc-1..5, echo, mixed-svc, authz-echo, authz-canary, uds-echo, uds-cr-echo. tcp-echo and udp-echo are excluded.
    today (2 dests) unconditional (≈ 11 dests)
    twins (fleet) 118 ≈ 650 (5.5×); active clusters 620 → ≈ 1,150
    @ stat series 6.2k ≈ 34k
    (A) heap ≈ 26 MiB ≈ 140 MiB (≈ 28 MiB/node)
    (A) CPU ≈ 0 (≤ 0.02) ≈ 0, bounded ≤ ≈ 0.12; main-thread CDS/flush ≈ +0.02
    (B) CPU +0.78 for 100 rps ≈ +2.7 cores for all 350 mesh rps: fleet ≈ 4.8 cores vs 2.09 all-h2 (≈ 2.3×)
    (B) heap +87 MiB (128 conn pairs) ≈ +300 MiB (458 mesh HTTP connections today)

    The (B) rows assume per-request cost stays at 7.8 ms. That is linear scaling at the current connection count and request mix; busier connections would lower it.

    5. Recommendation

    1. Don't expect demand-scoping to recover the CPU; that was a wrong hypothesis. Do it anyway, for memory, stats and CDS size, and because it is the natural fix shape for QUIC: a twin cluster added after its base is subscribed never receives EDS (delta WatchMap dedup on the shared EDS name) — 15 s of 503/NC for every new ServiceAccount on a node #1008: build a twin only for (SA, destination) pairs that have actually dialled. Today that would cut 118 → 10 twins (only aether-test/default dials svc-1/2 on each node), and it keeps the unconditional heap cost near 26 MiB instead of about 140 MiB.
    2. Twin health checks: nothing to cut. Twins inherit the service cluster's config, which has no active HC; readiness comes from EDS through the health_/inboundready_ clusters. A shared-HC design is unnecessary.
    3. The per-request cost of HTTP/3 is what gates feat(038): east-west QUIC is unconditional — the proving allow-list is gone #979. At this workload (small RPCs, ~0.8 rps per connection) it is about 3× h2. Before QUIC goes unconditional:
      • (a) Find out why each destination gets 64 connections fleet-wide (about 13 per node) for 50 rps. Fewer, busier QUIC connections per (source identity, destination) would amortise the ACK and flush alarms and the wakeups.
      • (b) Try UDP GSO on the upstream and listener writers and GRO on reads (none is configured in agent/internal/xds), and review the QUIC ACK-delay/ack-frequency settings.
      • (c) Set an explicit gate: per-QUIC-request proxy CPU ≤ ~1.5× h2, measured with this matched-window method, before the allow-list is dropped.
      • (d) Keep 2.88 cores as the QUIC baseline for the next soak, as the issue already says.

    Not measured, and why

    • Health-check rates: envoy_cluster_health_check_* is absent from Prometheus. This is answered from code plus the profile instead.
    • Build vs QUIC at load: there is no loaded run of the new Envoy build without QUIC. It is bounded only at idle (−1.3 %).
    • User-space attribution is a lower bound. The eBPF stacks are depth-truncated: only 28.7 % of envoy samples keep thread_start at the root, and Pyroscope's flamebearer JSON collapses about 60–70 % into a root-level other. Cumulative values for mid-stack frames (the tables above) are therefore lower bounds. Leaf user-space self-time (QUIC crypto, QPACK, memcpy) is not individually visible in the 260-node graph. That is why only ≥ 0.20 cores of B carries an explicit QUIC frame and the rest sits in generic kernel and scheduler frames.
    • Stats-flush cost, per cluster: below resolution. The whole main thread moved +0.003 cores.
    • QUIC bytes per request: upstream_cx_rx/tx_bytes are not emitted on @ clusters. The per-request payload is taken from svc-3/4 (92 B / 903 B).
    • RSS proper: there is no cadvisor RSS series, so envoy_server_memory_allocated (heap) is used instead.
  3. bpalermo commented on Sep 27, 2026

    @bpalermo
    OwnerAuthor

    Attributed (comment above): idle twins ≈ 0 CPU (fixed cost is memory + stat series), the HTTP/3 request path is ~97 % of the delta at ~3.3× the per-request cost of h2, driven by ~0.8 rps per QUIC connection. Split into two actionable issues: #1020 (demand-scope the twins) and #1021 (per-request cost: connection fan-out, GSO/GRO, ACK settings; ≤1.5× gate for #979). Closing this as the attribution it asked for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions