Skip to main content

Envoy performance · part 1 of 12

Envoy CPU cost of filters, settings and releases: a price list

By Otto van der Schaaf, We-Amp · · updated

Turning on tracing, adding a filter or putting a second proxy in the path all change what Envoy costs to run. This is a price list: CPU per request for each setting, feature and release, measured the same way every time, with the conditions next to every number.

This list prices common settings and filters, connection and upstream choices, a second proxy hop, configuration updates, stats sinks, the kernel’s CPU-vulnerability mitigations and thirteen official releases, each against the same proxy without the change. It is one machine (the mitigations section adds a cloud VM), one load level per row except the releases, and loopback networking. Read every figure as a price on that rig, not as a promise for yours. Each section names its session; what was added when lists them.

Key findings

On one bare-metal server over loopback, the larger prices per request:

  • Authorization and processing filters: an external authorization check adds about 55% CPU per request with an HTTP service and about 81% with a gRPC service (both lower bounds), and external processing (ext_proc) in its default mode about 100% with Envoy’s own gRPC client (a lower bound), about 79% with response_header_mode: SKIP. JWT authentication that verifies an RS256 token on every request adds about 32% (a lower bound; about 4% when every request hits the filter’s cache of verified tokens).
  • Observability: 100% trace sampling adds 34%.
  • Compression: compressing a 16 KB JSON response in the proxy adds 80% to 131% depending on the library (lower bounds, against the same proxy forwarding the body uncompressed).
  • TLS: with clients reconnecting every 10 requests, an ECDSA P-256 certificate instead of RSA-2048 saved 17.9%, and session resumption with an RSA-2048 certificate saved 17.4%. With keep-alive clients the certificate made no resolved difference.
  • Features that are on and take no action: ten HTTP filters that take no action on the traffic add +9.5% on a 4 KB proxied request (ten filters of our choice, about 5k cycles each as their mean), and with disabled: true on each entry we could not tell the chain from one without the filters. Six priced features of our choice, without a stats sink, measured +22.9% together, within 3 points of the +24.5% sum of their single rows. With the plain statsd sink over UDP added, the stack of seven measured +38.2%, about 6 points under the sum of its single rows and outside that band. Conditions: HTTP/1.1 without TLS, the JWT cache hitting every time, a compressor that does not compress.
  • Releases: on this machine a header-heavy direct response got about 7% cheaper from v1.32.13 to v1.40.2, and user-space instructions per request fell 12% (proxied) and 29% (header-heavy). Proxied requests held level in CPU: v1.40.2 costs about 1% more than v1.32.13 at the lower load, at the limit of what this setup resolves.
  • tcmalloc per-CPU caches are off in the official binary on glibc 2.35 or later; turning them on cut instructions 10% to 19% and did not change CPU measurably (details).

What to do: price the filters, tracing and sinks you run before tuning anything else. For ext_proc, skip the response headers unless the filter needs them, and prefer Envoy’s own gRPC client (envoy_grpc) for authorization and processing calls. List the HTTP filters in your chain, and for each one that never acts on a listener’s traffic, try disabled: true on its entry and compare CPU per request. Check that your conditions match a row’s before you reuse its figure. How the binary is built is a separate lever: a PGO and ThinLTO rebuild cut CPU per request by 20% to 40%.

Added CPU per request, 4 KB proxied, Envoy v1.40.2, one 2016 server, loopbackHorizontal bar chart of fifteen settings, each against the same proxy without it, with 95% intervals. From the largest: ext_proc default mode +99.7% (lower bound), ext_authz gRPC +80.7% (lower bound), ext_authz HTTP +54.5% (lower bound), 100% trace sampling +33.8% (lower bound), JWT with every token verified +32.1% (lower bound), Wasm filter +15.6% (lower bound), Lua filter +11.8% (lower bound), ten filters that take no action +9.5%, 1% trace sampling +7.0%, a compressor that compresses nothing +5.3%, JSON access log +4.5%, text access log +3.6%, default idle timeouts +2.3%, local rate limit +1.9%, retry policy +1.5%. The same figures are in the tables of this post.MeasuredLower bound: ran busier than the reference0%+20%+40%+60%+80%+100%ext_proc, default mode (envoy_grpc): +99.7% CPU per request, 95% interval +93.8 to +105.8, a lower boundext_proc, default mode (envoy_grpc)+99.7% (lower bound)ext_authz, gRPC service: +80.7% CPU per request, 95% interval +79.7 to +81.7, a lower boundext_authz, gRPC service+80.7% (lower bound)ext_authz, HTTP service: +54.5% CPU per request, 95% interval +53.4 to +55.7, a lower boundext_authz, HTTP service+54.5% (lower bound)Tracing, 100% sampling: +33.8% CPU per request, 95% interval +33.2 to +34.3, a lower boundTracing, 100% sampling+33.8% (lower bound)JWT, every token verified: +32.1% CPU per request, 95% interval +31.5 to +32.6, a lower boundJWT, every token verified+32.1% (lower bound)Wasm filter: +15.6% CPU per request, 95% interval +15.2 to +16, a lower boundWasm filter+15.6% (lower bound)Lua filter: +11.8% CPU per request, 95% interval +11.4 to +12.1, a lower boundLua filter+11.8% (lower bound)Ten filters that take no action: +9.5% CPU per request, 95% interval +8.48 to +10.53Ten filters that take no action+9.5%Tracing, 1% sampling: +7.0% CPU per request, 95% interval +6.5 to +7.5Tracing, 1% sampling+7.0%Compressor that compresses nothing: +5.3% CPU per request, 95% interval +4.7 to +5.8Compressor that compresses nothing+5.3%Access log, JSON: +4.5% CPU per request, 95% interval +3.8 to +5.2Access log, JSON+4.5%Access log, text: +3.6% CPU per request, 95% interval +2.7 to +4.5Access log, text+3.6%Default idle timeouts: +2.3% CPU per request, 95% interval +1.9 to +2.7Default idle timeouts+2.3%Local rate limit: +1.9% CPU per request, 95% interval +1.3 to +2.6Local rate limit+1.9%Retry policy: +1.5% CPU per request, 95% interval +0.9 to +2.2Retry policy+1.5%Added CPU per request, 4 KB proxied, Envoy v1.40.2, one 2016 server, loopbackHorizontal bar chart of fifteen settings, each against the same proxy without it, with 95% intervals. From the largest: ext_proc default mode +99.7% (lower bound), ext_authz gRPC +80.7% (lower bound), ext_authz HTTP +54.5% (lower bound), 100% trace sampling +33.8% (lower bound), JWT with every token verified +32.1% (lower bound), Wasm filter +15.6% (lower bound), Lua filter +11.8% (lower bound), ten filters that take no action +9.5%, 1% trace sampling +7.0%, a compressor that compresses nothing +5.3%, JSON access log +4.5%, text access log +3.6%, default idle timeouts +2.3%, local rate limit +1.9%, retry policy +1.5%. The same figures are in the tables of this post.0%+40%+80%MeasuredLower bound: ran busier than the referenceext_proc, default mode (envoy_grpc): +99.7% CPU per request, 95% interval +93.8 to +105.8, a lower boundext_proc, default mode (envoy_grpc)+99.7% (lower bound)ext_authz, gRPC service: +80.7% CPU per request, 95% interval +79.7 to +81.7, a lower boundext_authz, gRPC service+80.7% (lower bound)ext_authz, HTTP service: +54.5% CPU per request, 95% interval +53.4 to +55.7, a lower boundext_authz, HTTP service+54.5% (lower bound)Tracing, 100% sampling: +33.8% CPU per request, 95% interval +33.2 to +34.3, a lower boundTracing, 100% sampling+33.8% (lower bound)JWT, every token verified: +32.1% CPU per request, 95% interval +31.5 to +32.6, a lower boundJWT, every token verified+32.1% (lower bound)Wasm filter: +15.6% CPU per request, 95% interval +15.2 to +16, a lower boundWasm filter+15.6% (lower bound)Lua filter: +11.8% CPU per request, 95% interval +11.4 to +12.1, a lower boundLua filter+11.8% (lower bound)Ten filters that take no action: +9.5% CPU per request, 95% interval +8.48 to +10.53Ten filters that take no action+9.5%Tracing, 1% sampling: +7.0% CPU per request, 95% interval +6.5 to +7.5Tracing, 1% sampling+7.0%Compressor that compresses nothing: +5.3% CPU per request, 95% interval +4.7 to +5.8Compressor that compresses nothing+5.3%Access log, JSON: +4.5% CPU per request, 95% interval +3.8 to +5.2Access log, JSON+4.5%Access log, text: +3.6% CPU per request, 95% interval +2.7 to +4.5Access log, text+3.6%Default idle timeouts: +2.3% CPU per request, 95% interval +1.9 to +2.7Default idle timeouts+2.3%Local rate limit: +1.9% CPU per request, 95% interval +1.3 to +2.6Local rate limit+1.9%Retry policy: +1.5% CPU per request, 95% interval +0.9 to +2.2Retry policy+1.5%
Added CPU per request, 4 KB proxied, Envoy v1.40.2, one 2016 server, loopback. Each bar is one setting against the same proxy without it, with its 95% interval; the reference is a router-only proxy at about 525k cycles per request on this server; sessions of 15 to 23 November 2026; bars marked as lower bounds ran busier than the reference. The 4 KiB buffer row (a 16 KB shape) is not shown. Hover or tap a bar for its interval.

How every number is measured

  • Paired A/B, balanced order. The two configurations (the baseline and one changed setting; called arms below) run alternately in balanced order, 12 rounds or more per comparison unless the row says otherwise: A-B-B-A for two arms, rotated for three or more. Each round gives one paired ratio. The figure is the mean of those ratios as a percent change, with its 95% interval. Where a table compares several rows at once, the significance test is corrected for the number of rows.
  • Fixed load. An open-loop load generator sends the same request rate to both arms, so both serve the same traffic. Rates were chosen so the baseline proxy is about 25% to 33% busy on its four workers; a row measured at another load level says so. The load generator is Nighthawk’s nighthawk_client, built from We-Amp’s public Nighthawk fork at commit 5fc3897, using only client options that upstream Nighthawk also has.
  • Exact connection balancing. Except in the worker section, the new-connection rows of the companion post and the reference of the exact_balance row, the proxy’s listeners use exact_balance, which hands each new connection to the worker with the fewest open connections. In those runs many client connections are open at once (kept alive, about 16 at a time in the TLS reconnect rows, or 512 reconnecting every 10 requests in the exact_balance row), so the counts it compares are rarely all zero, and the validity gate checks that the load is spread over the workers unless a row says the check was off.
  • CPU is cycles on the proxy process. Hardware counters count user plus kernel cycles on the proxy alone and divide them by the responses it served. Client, origin and side services are not included. The worker-thread section is the one exception: the proxy runs in a pod there, and CPU is the pod’s CPU time from the kernel’s accounting, divided by the responses it served.
  • A validity gate that fails closed. Every run must reach its rate within 1%, have no request rejected by the load generator’s own queue limits (client overflow), and keep at least 25% headroom in the load generator. The proxy’s cores must be free of other work before and during the measurement window, the load must be spread across workers, and each hardware counter must run for the whole window rather than share time with others. From the settings runs onward the processor’s idle-state settings must also match at the start and the end of every run; the first release session, whose figures the releases section quotes, was run before that check existed and recorded the idle states once. The worker-thread section has its own checks, listed there. A run that fails any check is not counted. Where a check was switched off for a row, the row says so.
  • An A/A floor. The same binary and configuration run against themselves on the same machine set the size of difference the setup cannot tell from noise: about 1.2% on HTTP/1 proxied responses in the settings session (0.7% to 1.7% in the second release session, by shape and load) and about 1.9% on HTTP/2. Across the A/A runs this method was set on, pooled, a systematic bias larger than about 0.2% is excluded. Later sessions do not all fit that. On the header-heavy direct response, the second copy read lower than the first in all seven blocks of the two mitigation series, by 0.2% to 1.4%, and by 1.20% in one session of the code-layout post. We have not found the cause. In those sessions the header-heavy rows carry no finding: the mitigation rows on that shape are marked Not resolved and give no interval, and the code-layout column has no verdict, with its figures quoted at the widened interval. On that shape we claim no effect under about 1%. What remains is an offset of about 0.34% (one standard deviation) that each session carries on top of its own interval, so two sessions of the same comparison differ by about 0.48%.
  • Why the floor and the 1% line exist: how to benchmark a proxy’s CPU.
  • What that means for small numbers. An effect under about 1% from one run is not a finding, whatever its own interval says. An effect between 1% and 2% needs a second session, or an interval that still excludes zero once the between-session spread is added. Every line below says which case it is.
  • Kernel time is this server’s. The 2016 server needs page-table isolation, CPU buffer clearing and retpolines, so every kernel entry and exit costs more than on a current CPU; its default mitigations alone cost about 2.6% per keep-alive request (the mitigations rows). Rows whose price is mostly kernel time (the buffer limits, the write pattern of chunked bodies, the two empty kernel calls, the Unix domain socket) may come out smaller on a current CPU; that was not measured.

The harness and the raw data behind every row are public: github.com/We-Amp/envoy-price-list (code under Apache 2.0, data under CC BY 4.0). Why the method looks like this, and the flaw in our earlier runs that led to it, is under what we withdrew or dropped below; Envoy performance, measured has the short list.

To reproduce one row, for example 100% trace sampling, check out the harness at tag waves-2026-11. The configurations carry our paths, CPU sets and rates, so adapt examples/settings-matrix/04-tracing.json and the A/A file examples/settings-matrix/aa.json to your machine. The first three commands below need no Envoy: the self-test, a simulated run that checks a configuration, and the report, which on our records for that row regenerates our published summary. For the later sessions, check out tag waves-2026-11d and run python3 tools/fetch-wave-data.py, which fetches and verifies the release archives into data/waves/.

python3 bin/epl selftest
python3 bin/epl run examples/settings-matrix/04-tracing.json --dry-run --out <dir> --set client.binary=<your nighthawk_client> --set floor_from=data/settings-matrix/aa/results.json
python3 bin/epl report data/settings-matrix/04-tracing/results.json --floor data/settings-matrix/aa/results.json
# the later sessions, at tag waves-2026-11d:
python3 tools/fetch-wave-data.py

On the test machine, python3 bin/epl calibrate <config> --arm <arm> --shape <shape> --rps <rate,rate> picks rates and python3 bin/epl run <config> --set client.binary=<your nighthawk_client> measures; these two need Envoy and Nighthawk on that machine, so take them as illustrative. For your own run, python3 bin/epl report <run>/results.json --floor <A/A run>/results.json renders the table.

Settings

Common conditions for every line in this section:

  • the official Envoy v1.40.2 release binary, 4 workers;
  • a bare-metal dual-socket Intel Xeon E5-2673 v4 server, fixed 2.3 GHz, turbo off, Ubuntu 24.04 with kernel 6.8. The proxy is pinned to four cores of one socket with their hyperthread siblings left idle, and the load generator and origin run on the other socket;
  • the processor’s default idle states;
  • client and origin on loopback, HTTP/1.1 unless the line says otherwise; the origin is an nginx server;
  • the baseline arm about 30% busy. Costlier settings ran at up to 55% busy at the same request rate. On this machine busier cores cost less per request, so large costs are slightly understated;
  • latency is not part of this list unless a line says so.

Kernel cycles on loopback include part of the client’s and origin’s receive work. That is fair for comparing arms. It is not what a deployment behind a network card pays.

Setting (against the baseline) Traffic CPU per request [95% interval]
ECDSA P-256 certificate instead of RSA-2048 TLS 1.3, reconnect every 10 requests, 2,800 req/s −17.9% [−18.1, −17.7]
ECDSA P-256 instead of RSA-2048 TLS 1.3, keep-alive, 4,800 req/s no resolved difference
TLS session resumption on, RSA-2048 TLS 1.3, reconnect every 10 requests, 2,800 req/s −17.4% [−17.7, −17.1]
HPACK dynamic table size 0 instead of 4,096 HTTP/2, header-heavy direct response, 8,000 req/s about +7% [+5, +9]
OpenTelemetry tracer, 0% sampling 4 KB proxied, 5,200 req/s +6.7% [+6.2, +7.3]
OpenTelemetry tracer, 1% sampling same +7.0% [+6.5, +7.5]
OpenTelemetry tracer, 100% sampling same +33.8% [+33.2, +34.3], a lower bound
File access log, default text format same +3.6% [+2.7, +4.5]
File access log, JSON same +4.5% [+3.8, +5.2]
External authorization, HTTP service same +54.5% [+53.4, +55.7], a lower bound
External authorization, gRPC service same +80.7% [+79.7, +81.7], a lower bound
Retry policy configured, no retries triggered same +1.5% [+0.9, +2.2], near the floor
JWT authentication, local JWKS, RS256, every token verified 4 KB proxied, 5,200 req/s +32.1% [+31.5, +32.6], a lower bound
JWT authentication with the filter’s cache of verified tokens same, one token on every request +4.3% [+3.9, +4.7], the cache’s best case
Local rate limit, enforced on every request, never triggered same +1.9% [+1.3, +2.6], near the floor
Per-connection buffer limit of 4 KiB 16 KB proxied, 5,440 req/s +20.6% [+20.0, +21.1]
tcmalloc per-CPU caches on 4 KB proxied and header-heavy direct no measurable change
A second proxy hop, both proxies evenly loaded 4 KB proxied, 5,200 req/s +99.6% [+98.9, +100.3] for the pair

The details and the conditions specific to each line follow. The configurations are in examples/settings-matrix/ of the harness repository, one file per row (01- to 10-), with the follow-up runs in followups/ and the JWT and rate-limit rows in filters/; the raw results are in data/settings-matrix/, data/settings-followups/ and data/settings-filters/.

TLS certificate: ECDSA P-256 instead of RSA-2048

About 1.7M cycles (≈0.78 ms of CPU on this machine) less per full TLS 1.3 handshake. With a new connection every 10 requests, reconnects spread out in time (about 16 client connections at a time) and no session resumption, that is −17.9% CPU per request [−18.1, −17.7] (2,800 req/s, 4 KB responses). An earlier run in which all connections reconnected at the same moment gave −18.0%. There is no resolved difference on keep-alive connections (−0.7% [−1.5, +0.2], 4,800 req/s). Negotiated on every handshake: TLS 1.3, AES-128-GCM, key exchange X25519MLKEM768. A later session priced a whole new connection with each certificate, and the key exchange on its own: What Envoy connections cost in CPU.

TLS session resumption on (against off)

About 1.7M cycles (≈0.76 ms of CPU on this machine) less per resumed handshake with an RSA-2048 certificate. With a new TLS 1.3 connection every 10 requests, reconnects spread out in time (about 16 client connections at a time) and every reconnect resumed, that is −17.4% CPU per request [−17.7, −17.1] (2,800 req/s, 4 KB responses). An earlier run with reconnects at the same moment gave −18.6%. A resumed handshake with an RSA-2048 certificate costs about the same as a full handshake with an ECDSA P-256 certificate. Negotiated parameters as for the certificate line. With an ECDSA P-256 certificate, resumption made no measurable difference in CPU in a later session (What Envoy connections cost in CPU).

For the TLS lines the client’s queue checks were relaxed. In the reconnecting shape, every request that opens a new connection waits for its handshake, so the count of waiting requests equals the count of new connections and that check cannot fail; client overflow stayed checked and was zero in every run. In the keep-alive shape every client connection does a full handshake at once at start-up, before the measurement window. Requests then queue in the client: with RSA certificates about 900 to 1,200 overflow events and up to about 1,000 waiting requests per run, with ECDSA no overflow and up to about 300 waiting requests. That start-up overflow was not counted, and the waiting count was bounded instead. No request was dropped: the counters that mean a drop stayed checked and at zero, the rate at the proxy met its target in every run, and the client kept 75% to 77% headroom. The certificates are self-signed leaves with no intermediate, and every handshake negotiated TLS 1.3.

HTTP/2 HPACK dynamic table off (size 0, against the default of 4,096)

About +7% CPU per request [+5, +9] on header-heavy HTTP/2 direct responses (no upstream): 16 request headers from the client and 52 response headers, identical on every request, 16 connections, 8,000 req/s. Identical headers are the case where the dynamic table helps most. The HTTP/2 A/A floor, measured in a later session on the same machine, binary and configuration, is about 1.9%. Larger table sizes were not measured.

Tracing: OpenTelemetry tracer, gRPC export to a local collector

Against no tracer: +6.7% [+6.2, +7.3] at 0% sampling, +7.0% [+6.5, +7.5] at 1%, +33.8% [+33.2, +34.3] at 100%. At 0% the proxy still builds a span and propagates trace context for every request; only the export is skipped. No sampler extension of this tracer in this release avoids building the span: the sampler runs after the span has been created. Measured on 4 KB proxied responses at 5,200 req/s. The collector’s own CPU is not included. The split into a fixed and a sampled part is in OpenTelemetry tracing: fixed and sampled cost.

File access log

+3.6% CPU per request [+2.7, +4.5] in the default text format and +4.5% [+3.8, +5.2] as JSON with the 15 standard fields. Measured on 4 KB proxied responses at 5,200 req/s, one line per request, including the log flush thread.

External authorization (ext_authz): one check per request, always allowed

With an HTTP service, about 285k cycles (≈130 µs of CPU on this machine) per check, +54.5% CPU per request [+53.4, +55.7]. With a gRPC service, called through the proxy’s own gRPC client over HTTP/2, about 424k cycles (≈190 µs) per check, +80.7% [+79.7, +81.7]. Both on a 4 KB proxied response at 5,200 req/s, with connections to the service kept alive and the request body not sent to the service. About four fifths of the added cycles are user-space work in the proxy. Both ran busier than the reference at the same request rate (47% and 55% against 31%), and on this machine busier cores cost less per request, so read both figures as lower bounds. The service’s own CPU is not included. A repeat on 17 November, with a header-heavy direct response, is in Features and filters. A third session, with external processing (ext_proc) and Envoy’s other gRPC client, is in External processing (ext_proc) and the gRPC client.

Retry policy configured, no retries triggered

About +1% to 2% CPU per request (+1.5% [+0.9, +2.2]; instructions +1.2%), 4 KB proxied responses, 5,200 req/s. One session. With the between-session spread added the interval is [+0.6, +2.4], and cycles were higher in all 12 rounds, so the direction holds. The size is close to the smallest effect this setup resolves.

JWT authentication (local JWKS, RS256)

About 173k cycles (≈78 µs of CPU on this machine) per verified token, on a 4 KB proxied response (+32.1% CPU per request [+31.5, +32.6]) and on a header-heavy direct response (8,000 req/s, +60.3% [+58.1, +62.6]). One provider with a local JWKS (one RSA-2048 public key, no fetch), required on every route, issuer, audience and expiry checked, the token forwarded upstream. The reference sends the same 530-byte token, so only the filter differs. The filter ran busier than the reference at the same rate (41% against 32% on the 4 KB shape, 41% against 26% on the direct response), and on this machine busier cores cost less per request, so read the percentages and the cycle figure as lower bounds.

With the filter’s cache of verified tokens, 23k to 27k cycles (≈11 to 12 µs) per request remain: +4.3% [+3.9, +4.7] on 4 KB proxied, +9.2% [+7.8, +10.7] on the direct response. That is the cache’s best case: a cache of 100 tokens and one token in use, so every request was a hit. A workload with many distinct tokens was not measured; with more distinct tokens than the cache holds, expect at least the price of verifying every token. Other algorithms, a remote JWKS and other token sizes were not measured.

Local rate limit, never triggered

About +2% CPU per request on a 4 KB proxied response (+1.9% [+1.3, +2.6]; instructions +2.3%) and +4.0% [+3.0, +5.0] on a header-heavy direct response (8,000 req/s): about 10k cycles (≈4.5 µs) per request on both. One session. With the between-session spread added the 4 KB interval is [+1.0, +2.8], and cycles were higher in 11 of 12 rounds, so the direction holds; the size is close to the smallest effect this setup resolves. One token bucket shared by the 4 workers, enabled and enforced on every request, with a budget far above the request rate, so no request was rejected. The cost of rejecting requests, per-connection buckets, descriptors and more workers on one bucket were not measured.

Per-connection buffer limit of 4 KiB on the listener and the upstream cluster (against the default of 1 MiB)

+20.6% CPU per request [+20.0, +21.1] on 16 KB proxied responses, 5,440 req/s. The cost is mostly kernel time and comes from flow control on bodies larger than the limit: the proxy pauses reading from the upstream about twice per response. There is no measurable cost on 2 KB responses, which fit within the limit (−0.5% [−1.3, +0.3], 5,200 req/s). One limit and one body size were measured. A later session priced a 32 KiB limit on 64 KiB responses (+19.0% [+17.9, +20.2]) and counted the pauses and epoll_ctl calls behind both rows: Per-connection buffer limit: pauses, resumes and epoll_ctl.

tcmalloc per-CPU caches

With the official binary on glibc 2.35 or later they are off. The caches need tcmalloc to register restartable sequences (rseq) for each thread, and glibc registers rseq for every thread first, so tcmalloc’s registration fails. Setting GLIBC_TUNABLES=glibc.pthread.rseq=0 stops glibc’s registration and turns the caches on (measured on glibc 2.39). Instructions per request fall 10% (4 KB proxied) and 19% (header-heavy direct response). CPU per request does not change measurably: −0.9% [−1.7, −0.1] and +1.6% [+0.3, +2.9], neither significant once corrected for the number of rows. The setting disables glibc’s own use of restartable sequences for the process and its children.

A second proxy hop (client → proxy → proxy → origin, plaintext HTTP/1.1)

About double. With both proxies evenly loaded at about 30% busy, the pair costs +99.6% proxy CPU per request [+98.9, +100.3] against one proxy. Per hop there is no measurable difference from a single proxy (−0.2% [−0.6, +0.1]). 4 KB proxied responses at 5,200 req/s. Both proxies ran on the same socket. A repeat on 22 November gave +98.7% [+96.6, +100.9], with mutual TLS on the hop between the proxies as a further row: What Envoy connections cost in CPU. When the second proxy relays TCP (tcp_proxy) instead of proxying HTTP, the pair cost 33% less CPU per request (−32.9% [−33.6, −32.3], one session on 23 November). That hop gives up everything Envoy does per request, from balancing and retries to HTTP stats, logs and header policy: What a second Envoy hop costs in CPU.

To load the second proxy evenly, every proxy in this measurement, the single-proxy reference included, used one upstream connection pool per downstream connection (connection_pool_per_downstream_connection). That setting costs nothing measurable on one hop (−0.1% [−0.6, +0.4]). It is a measurement device here, not a recommendation: it stops upstream connections from being shared and keeps them open after the downstream connection has closed, until the idle timeout.

With the default shared pool and a fast origin, few requests are in flight at once. The first proxy then reuses a few connections towards the second, and one worker of the second proxy carries most of its load (40% to 88% of it here, at 52% to 94% of a core, against 32% when evenly loaded). That chain cost less than the evenly loaded pair, +84% to +90% against +99.6%, in two runs. Its headroom is set by that one worker instead of four. For that chain the check for evenly spread load was off on the second proxy.

Features and filters

Conditions for this section: the same machine and method as the settings above (official v1.40.2, 4 workers unless a row says otherwise, HTTP/1.1 over loopback, client and side services on the other socket). Two sessions, on 17 and 18 November 2026, 16 to 30 rounds per comparison. Every run passed the validity gate with no check switched off, and every A/A check (the same configuration against itself) passed. Tracing, the 4-worker access logs, compression and the Lua and Wasm rows take their A/A floor from an earlier run in the same session; the other rows carry their own in the same rounds.

  • Traffic shapes. “4 KB proxied” is a 4 KB response from the origin. “Header-heavy direct” is a direct response with no upstream whose route adds 52 response headers.
  • “A lower bound”. With the setting on, the proxy ran busier than the reference at the same request rate, and on this machine busier cores cost less per request.
  • “Secondary”. Reported, but not among the comparisons named before the session ran.

Each cell is the change in the proxy’s CPU per request (total user and kernel cycles on the proxy process, divided by the responses it served) with the setting on, against the same configuration without it, with its 95% interval.

Setting (against the same configuration without it) 4 KB proxied (5,200 req/s unless the cell gives a rate) Header-heavy direct (8,000 req/s unless the cell gives a rate) Earlier session, 4 KB proxied (settings table above)
Lua filter (inline script), reads the path and adds one header each way +11.8% [+11.4, +12.1], a lower bound +16.7% [+15.7, +17.7], a lower bound –
Wasm filter (V8, Rust proxy-wasm), the same job +15.6% [+15.2, +16.0], a lower bound +23.2% [+22.3, +24.2], a lower bound –
Empty Lua filter (runtime minimum; secondary) +7.2% [+6.9, +7.5] +9.8% [+8.9, +10.6] –
Empty Wasm filter (runtime minimum; secondary) +9.7% [+9.2, +10.1] +13.6% [+12.6, +14.7] –
Default stream and downstream connection idle timeouts, against both off +2.3% [+1.9, +2.7] +3.9% [+3.1, +4.7] (secondary) –
OpenTelemetry tracer, 10% sampling (secondary) +9.6% [+8.9, +10.3] +15.6% [+14.7, +16.5] –
File access log, 16 workers (against 16 workers without a log) at 20,800 req/s: text +3.3% [+2.7, +3.9], JSON +3.8% [+3.4, +4.2] not measured –
OpenTelemetry tracer, 1% sampling +7.2% [+6.5, +8.0] +9.9% [+8.7, +11.2] +7.0% [+6.5, +7.5]
OpenTelemetry tracer, 100% sampling +33.6% [+32.8, +34.5], a lower bound +57.2% [+55.8, +58.5], a lower bound +33.8% [+33.2, +34.3]
File access log, default text format +3.7% [+3.3, +4.0] +5.6% [+4.5, +6.6] +3.6% [+2.7, +4.5]
File access log, JSON, 15 fields +4.6% [+4.3, +5.0] +7.1% [+6.2, +7.9] +4.5% [+3.8, +5.2]
External authorization (ext_authz), HTTP service, always allowed +54.1% [+53.0, +55.3], a lower bound at 6,000 req/s: +102.4% [+100.9, +103.8], a lower bound +54.5% [+53.4, +55.7]
External authorization (ext_authz), gRPC service, always allowed +80.0% [+78.8, +81.2], a lower bound at 6,000 req/s: +145.8% [+143.9, +147.7], a lower bound +80.7% [+79.7, +81.7]
Retry policy (5xx,reset,connect-failure, 2 retries), no retries triggered about +1.3% [+1.0, +1.7], near the floor not priced: a direct response has no upstream, so no retry can happen (measured, near the floor) +1.5% [+0.9, +2.2]
tcmalloc per-CPU caches on under 1% (−0.5%), not a finding under 1% (+0.7%), not a finding no measurable change (−0.9% proxied / +1.6% direct)

The first seven rows are new. The last eight repeat settings from the table above, and each repeat agrees with the earlier session; the last column shows the earlier figure beside the new one. Both sessions ran the same binary on the same machine, so the repeat confirms the measurement and says nothing about another build or machine.

An authorization check costs about the same on both shapes: about 285k to 310k cycles with an HTTP service and 420k to 440k with a gRPC service, approximate because the load gaps differ. The direct-response percentages are larger mainly because that reference does less work per request. The authorization rows on the direct response ran at 6,000 req/s, where the reference was about 21% busy. Conditions for the authorization rows: connections to the service kept alive, request body not sent, the service’s CPU not included. Requests with many headers were not measured.

Compression: gzip, brotli and zstd

Compressing a proxied JSON response in Envoy adds 50% to 54% CPU per request at 4 KB and 80% to 131% at 16 KB, with gzip, brotli and zstd at Envoy’s default settings. Every figure is a lower bound. Which library costs least depends on the size: gzip at 4 KB, by 2 to 3%; zstd at 16 KB, where it used 22% fewer cycles per request than gzip and 16% fewer than brotli.

Conditions: Envoy’s compressor filter, response direction; proxied JSON responses (synthetic JSON with repeated keys and high-entropy values); Accept-Encoding: gzip, br, zstd sent by every client, the reference included. Each library runs at the defaults in Envoy’s API reference, set explicitly in the config: gzip (zlib-ng in the v1.40.2 source) level 6, window bits 12, memory level 5; brotli quality 3, window bits 18; zstd level 3; output chunk size 4,096 bytes for all three. These are Envoy’s defaults, not the libraries’ own. One exception: with the chunk size left unset, zstd in the v1.40.2 source uses a larger output buffer than the 4,096 bytes set here. That case was not measured.

Percentages are the change in the proxy’s CPU per request against the same proxy forwarding the body uncompressed, with 95% intervals.

Library 4 KB JSON, 5,200 req/s 16 KB JSON, 4,000 req/s Proxy CPU added per request (4 KB / 16 KB) Compressed body size (from 4,096 / 16,384 B)
gzip +49.6% [+48.8, +50.3] +131.0% [+129.8, +132.2] 263k / 747k cycles (≈120 / 340 µs) 1,364 / 4,266 B
brotli +53.0% [+51.9, +54.0] +113.6% [+112.4, +114.8] 281k / 648k cycles (≈128 / 294 µs) 1,351 / 4,250 B
zstd +54.0% [+52.8, +55.1] +80.2% [+79.0, +81.4] 286k / 457k cycles (≈130 / 208 µs) 1,366 / 4,291 B
gzip compressor filter that compresses nothing (4 KB body of a content type not in its list, not JSON) +5.3% [+4.7, +5.8] not measured 28k cycles (≈13 µs) unchanged

The three libraries reached nearly the same size on this body (3.0:1 at 4 KB, 3.8 to 3.9:1 at 16 KB). Beyond the totals above, zstd at 16 KB had 39% fewer added cycles (the compression work itself) than gzip. With compression on, the proxy ran 19 to 32 percentage points busier than the reference at 16 KB, against 14 to 16 at 4 KB. So the 16 KB figures are understated more than the 4 KB ones, and by a different amount per library, which means the two columns do not give a cost per kilobyte. The filter flushes after each body chunk; these bodies arrived in about two chunks per response with every library. A smaller response also saves kernel work. On loopback that saving includes the client’s receive work, which a real network moves to another host. The user-space part of the price is what carries over. Other levels, other content, bodies above 16 KB and decompression were not measured.

The last row is one gzip compressor filter (as configured: response direction only, no per-route override) that leaves every response alone because its content type is not in the filter’s list, with the client sending Accept-Encoding. That costs somewhat less than an empty Lua filter on the proxied shape (28k against 38k cycles per request). Other reasons not to compress (no Accept-Encoding, a short body, Cache-Control: no-transform, an existing Content-Encoding) take other paths in the filter. They were not measured and may not cost the same.

Lua and Wasm filters

For the same job, a request cost more CPU with Wasm than with Lua: 3.5% more on the proxied shape and 5.6% more on the direct response, measured in the same rounds. The filter’s own added cycles were a third to two fifths higher (82k against 62k proxied, 66k against 47k direct).

The empty filters show each runtime’s minimum and are not a like-for-like pair. The empty Lua script has two empty functions and runs twice per request. The empty Wasm module exports every SDK callback, and a trace showed at least six entries into the VM per request, including one for each response body chunk. Only the empty module was traced.

Conditions: the Wasm module is built with the Rust SDK. In the v1.40.2 source, a module that exports fewer callbacks is entered less often. The runtimes are those pinned in the v1.40.2 dependency list (the harness did not record their versions). Body access, HTTP calls, shared state and other Wasm runtimes were not measured.

OpenTelemetry tracing: fixed and sampled cost

Below a few percent, lowering the sampling rate further removes almost nothing: at low rates most of the cost is paid on every request, sampled or not. A straight line through the 1% and 100% measurements splits the added cycles into a part paid on every request, 37k cycles (≈17 µs) proxied and 27k (≈12 µs) direct, and a part per sampled request, 140k (≈64 µs) and 134k (≈61 µs). The 100% figure is a lower bound, so the split is approximate. At 1% sampling the part paid on every request is 94% to 96% of the added cost under that model. On the proxied shape that part is about 73% of the added cost at 10% sampling and 21% at 100%. At 100% the per-sampled part, which includes the export, is about four fifths of the price.

On the proxied shape, every upstream request is 84 bytes larger at every sampling rate. That is consistent with Envoy adding a traceparent header (70 bytes) and an empty tracestate header (14 bytes); we did not capture the headers. In the v1.40.2 source, a configured tracer starts a span object for every request, and for unsampled spans the proxy skips the end-of-request tag work and the export. How the cycles divide over these steps was not profiled.

Conditions: OTLP over gRPC to a collector on another socket, its CPU not included; sampling set with random_sampling on the HTTP connection manager, no sampler extension on the tracer; exporter at its defaults, which in the v1.40.2 source send a batch for every 5 spans per worker (batch size was not varied; it would be expected to change the per-sampled part); no incoming trace context. OTLP over HTTP and other tracers were not measured. A candidate patch of ours that puts off building the span until a request is sampled lowered the cost at 0% sampling by about 2% to 3% of the request, with 0% random sampling, no sampler extension and no incoming trace context: A deferred OpenTelemetry span at 0% sampling.

Default idle timeouts

Envoy’s default idle timeouts cost +2.3% CPU per request [+1.9, +2.7] on the 4 KB proxied shape and +3.9% [+3.1, +4.7] (secondary) on the direct response, against both set to zero (disabled): about 11k cycles (≈5 µs) per request, in user space. Idle timeouts protect against stuck clients and leaked connections; Envoy’s API reference warns against disabling the connection timeout, and the v1.40.2 timeouts guide recommends keeping the stream timeout. The timeouts are the HTTP connection manager’s stream_idle_timeout (default 5 min) and the downstream connection idle_timeout in its common HTTP protocol options (default 1 h); the upstream connection idle timeout stayed at its default in both configurations. In the v1.40.2 source, setting the stream idle timeout to zero also removes the default it supplies for the stream flush timeout.

In the v1.40.2 source, the proxy re-arms the stream timer on each header and body event and toggles the connection timer as requests start and finish. That is consistent with the price coming from arming the timers. If so, a longer timeout would not lower it; that was not measured. One session, both timers changed together, so which one carries the cost is not known.

A later session (23 November 2026, 6 rounds; conditions as in Features that are on and take no action) turned three timers off: the two above and the upstream connection idle timeout.

Row (against Envoy’s defaults) 4 KB proxied Header-heavy direct Basis
Stream idle, downstream connection idle and upstream connection idle timeouts all set to 0s −2.81% [−3.61, −2.01] (−14.8k cycles) −3.48% [−5.22, −1.71] (−9.7k cycles) Measured; side of our 3% threshold Not resolved
The same plus the route timeout at 0s −4.05% [−5.10, −2.99] −3.26% [−4.13, −2.38] Measured
The route timeout’s own share (the second row against the first) −1.27% [−2.12, −0.42] +0.23% [−1.23, +1.72] Exploratory
The three idle timeouts at 0s on streamed responses From the session of Bodies, buffers and streams: no price not applicable Not resolved

The streamed row has no price because both kinds of streamed response failed their same-build check; the readings were −2.48% [−8.63, +4.08] with 200 events and −2.19% [−5.22, +0.95] with 20.

Turning the idle timers off saves 2.8% on a 4 KB proxied request and 3.5% on a header-heavy direct response. Before the run we set a threshold of 3% for a change that would arm these timers lazily. Both intervals cross it, and the header-heavy row cannot be placed on either side. These figures are the upper bound for such a change. They are not a setting to recommend: with the idle timeouts at 0 nothing reaps idle connections. A lazy-timer change could save at most this much, so we built no patch.

The saving is user time. The rows above give +2.3% [+1.9, +2.7] and +3.9% [+3.1, +4.7] for the default stream and downstream connection idle timeouts. The later configuration also turns off the upstream connection idle timeout. On the direct response there is no upstream, so that row is a repeat and it agrees. On the proxied shape it has one more timer off and measured 0.5 points larger; the two are consistent and not the same comparison. The route timeout’s own share includes the x-envoy-expected-rq-timeout-ms header that is no longer sent, so it is not all a timer. On streamed events, turning the idle timers off removed 5.5% of user instructions [4.8, 6.1] in 6 of 6 rounds (Exploratory), and three exploratory readings put the saving at about 1% to 2.5% of cycles, under the 5% threshold we had set for streams; this run could not resolve it.

File access log at 16 workers

At 16 workers and 20,800 req/s, one shared log file costs +3.3% (text) and +3.8% (JSON), against +3.7% and +4.6% at 4 workers, so no sign of costing more per request at 16 than at 4. The two come from different runs with different baselines, so this does not show that it costs less. Flushing is at Envoy’s defaults (in the v1.40.2 source, 64 KiB buffered or every 10 s; at these rates the size trigger fires many times a second), and the flush thread’s CPU is included. The file is written into the page cache; disk writeback is not included.

tcmalloc per-CPU caches, second session

Turning tcmalloc per-CPU caches on again changed CPU per request by under 1% on both shapes, not a finding (4 KB proxied: interval with the between-session spread [−1.26, +0.19]; direct response: at most +1.6%). Instructions per request again fell 10% (proxied) and 19% (direct); cycles per request did not fall with them.

The data is in data/features/2026-11-17/ and data/features/2026-11-18/ of the harness repository.

Features that are on and take no action

A feature can cost CPU on requests it takes no action on. Other sections price three such cases: a compressor that compresses nothing (+5.3%), a tracer at 0% sampling (+6.7%) and the default idle timeouts (+2.3%). This section adds ten HTTP filters that take no action on the traffic, and seven features priced together.

Conditions for this section: one session on 23 November 2026 on the same machine and with the same measure of CPU as the settings above, the official v1.40.2 binary, 4 workers, HTTP/1.1 over loopback. 6 rounds in a balanced order, with a second copy of the reference configuration (A/A) in the same rounds for each traffic shape. Per-request intervals are the wider of the plain interval and the one with the between-session spread. The kernel ran its default mitigations, and connection tracking was active on loopback. Two departures from our plan. The plan forbids a login on the machine during measured runs; an interactive session stayed open on the machine during the runs. We kept the rows: other tasks used at most 0.003 of a CPU on the proxy’s cores in any run. And the order of the traffic shapes was fixed instead of rotated by round; the order of the configurations within a shape was balanced, so comparisons within a shape are not affected. The same two departures apply to Bodies, buffers and streams.

Ten HTTP filters that take no action

Setting (against the same configuration without it) 4 KB proxied, 5,200 req/s Header-heavy direct, 8,000 req/s Basis
Ten HTTP filters before the router, configured so that none acts on this traffic +9.50% [+8.48, +10.53] (+50.0k cycles) +17.01% [+15.13, +18.93] (+47.6k cycles) Measured
The same ten, each with disabled: true −0.34% [−1.29, +0.63] +0.94% [−0.94, +2.85] Measured; no difference resolved
  • The ten: cors, fault, rbac, health_check, header_mutation, csrf, grpc_web, stateful_session, bandwidth_limit, grpc_http1_bridge. The choice is ours.
  • The traffic is a GET with no origin header, no gRPC content type and no body, on HTTP/1.1. None of the ten acts on it: for six, the filter’s action counters stayed at 0 in every run; for four, by our reading of the v1.40.2 source.
  • Same-build check: −0.20% [−0.99, +0.60] proxied, +0.03% [−2.16, +2.26] header-heavy. Rows on the header-heavy shape are resolved to about ±2 points in this run.

Ten HTTP filters that are configured and take no action on this traffic cost +9.5% CPU on a 4 KB proxied request and +17% on a header-heavy direct response. In cycles the two are nearly the same (+50.0k and +47.6k per request): the percentage is larger on the direct response because that request does less work to begin with. That is about 5k cycles per filter per request, the mean of these ten on HTTP/1.1. It is all user time, and no new syscall appears. The figure includes whatever each filter does before it decides not to act (for example, rbac without rules builds and drops an empty message, and header_mutation builds a formatter context). We did not split the cost by filter, and no run varied the number of filters, so “per filter” is the mean of these ten and not a price for any one of them.

With disabled: true on each filter entry we could not tell the chain from one without the filters. On the 4 KB proxied request at most 0.6 of the 9.5 points can remain. On the header-heavy response the run is less sharp: up to 2.9 of the 17.0 points could remain.

What to do: list the HTTP filters in your chain. For each one that never acts on a listener’s traffic, try disabled: true on its entry and compare CPU per request before and after. A disabled filter can still be enabled for the routes that need it, through per-filter configuration on the route.

A stack of seven features

We chose this stack. It is not a survey of deployments and it copies nobody’s defaults: it is our choice of seven features that each have a single row in this list, each in the state that row measured. All rows are on 4 KB proxied at 5,200 req/s.

Row (against the same proxy without the features, unless the row says otherwise) CPU per request [95% interval] Basis
Six features, no stats sink +22.93% [+21.77, +24.09] (+123.0k cycles) Measured
The same six plus the plain statsd sink over UDP: the stack of seven +38.17% [+36.91, +39.44] (+204.8k cycles) Measured
The stack with two cheaper settings: a text access log and the OpenTelemetry stats sink in place of JSON and statsd +22.23% [+20.90, +23.58] (+119.3k cycles) Measured
The cheaper settings against the stack of seven −11.54% [−12.45, −10.62] (−85.5k cycles) Measured
The statsd sink inside the stack, against the stack without it +12.40% [+10.92, +13.91], which is +15.2% of the proxy without the features Exploratory

Conditions that belong to every figure in this table:

  • The six: a JSON file access log, the OpenTelemetry tracer at 1% sampling with export to a local collector, a gzip compressor that does not compress the response, JWT authentication with its token cache, a local rate limit and a retry policy.
  • HTTP/1.1 without TLS on loopback, a 4 KB body, one cluster and a few hundred stats (407 to 586), stats flushed every 5 s.
  • Every configuration, the reference included, receives the accept-encoding and authorization request headers of the compressor and JWT rows above.
  • The JWT cache hits on every request. Verifying the token on every request costs +32.1% in the settings row.
  • The sink is the plain statsd sink over UDP: one datagram per histogram sample, 3.01 per request. The dog_statsd sink’s datagram batching was not measured here.
  • 64% of what the cheaper settings save is kernel time (Exploratory). On loopback the datagram’s delivery is paid in the sender’s call; on a real network part of that moves to the receiver.
  • No TLS, no external authorization or processing, no Lua or Wasm, no HTTP/2 or HTTP/3.
  • Same-build check: +0.14% [−0.79, +1.07] on the reference and +0.30% [−0.49, +1.10] at the stack’s load.

Do the single rows add up? For the six features without a stats sink, yes. Their six rows in this list sum to +24.5% (4.5 + 7.0 + 5.3 + 4.3 + 1.9 + 1.5), and the six together measured +22.9% [21.8, 24.1], in simple percent: 1.57 points under the sum and inside the band of 3 points we set before the run. That is one stack in one session. For the stack of seven, no. With the plain statsd sink’s row in Batched statsd datagrams (+19.4%, the session of 21 November at 5,200 req/s with 1,000 clusters; this stack has a few hundred stats) the single rows sum to +43.9%, and the stack measured +38.2% [36.9, 39.4]: about 6 points under the sum and outside the band. This run does not show whether the difference in stat count accounts for the gap, and we offer no explanation for it.

The two cheaper settings save 11.5% of the stack’s CPU per request (−11.5% [−12.5, −10.6]). That is 11.5% of the stack with all seven features on, 42% of what the stack adds over the proxy without them, and 15.9 points of that proxy’s CPU (+38.2% down to +22.2%). By point estimate most of it is the sink (81.8k of 85.5k cycles; Exploratory). The cheaper version changes two settings at once, and the rest is a net figure near zero (−0.56% [−1.55, +0.44]) that mixes the text log’s saving with the OpenTelemetry sink’s cost. Neither part is shown separately.

Bodies, buffers and streams

Conditions for this section: one session on 23 November 2026 on the same machine, with the official v1.40.2 binary, 4 workers, one proxy and an HTTP/1.1 client over loopback. 6 rounds in a balanced order, a second copy of the reference configuration (A/A) in the same rounds for every traffic shape, and the two departures named in the section above. Sizes of bodies, chunks and limits are in KiB and MiB; “4 KB” and “16 KB” in the name of a published shape mean 4,096 and 16,384 bytes. Measured [mechanism] marks a count or a profile share from one extra run under a tracer or profiler, never a price.

Chunked HTTP/1 bodies from the upstream

Row 64 KiB body, 4,000 req/s 1 MiB body, 800 req/s Basis
Chunked (8 KiB chunks) against a content-length arriving in the same 8 KiB writes: framing and copy +5.36% [+4.12, +6.61] (+37.4k cycles) +8.76% [+7.99, +9.53] (+295.3k cycles) Measured
Chunked (8 KiB chunks) against a content-length in one origin write: what a chunked backend costs, write pattern included +16.26% [+14.78, +17.76] +39.47% [+38.47, +40.48] Measured
Chunked (4 KiB chunks) against a content-length in one origin write +28.67% [+27.11, +30.25] +93.45% [+91.84, +95.07] Measured
The write pattern alone: a content-length in 8 KiB flushed writes against one write +10.35% [+9.27, +11.44] +28.24% [+27.31, +29.17] Exploratory
The copy in the HTTP/1 parser, share of worker cycles, chunked against the same writes with a content-length not profiled 5.5% against 0.0% Measured [mechanism]
  • The origin is a small server of our own that sends one chunk per write, or the same bytes with a content-length in one write or in the same flushed 8 KiB writes. Request lines have the same length in every configuration. The origin used at most 0.194 of its CPU set.
  • Same-build check: +0.02% [−0.83, +0.87] at 64 KiB, −0.05% [−0.75, +0.65] at 1 MiB.

A chunked upstream body costs Envoy 5% more CPU at 64 KiB and 9% more at 1 MiB than the same bytes with a content-length arriving in the same writes (+5.4% [4.1, 6.6]; +8.8% [8.0, 9.5]), all of it user time. Kernel cycles moved by +1.42% and +0.17%. The two configurations make about the same number of syscalls: 11.8 against 11.6 per request at 64 KiB, 53.8 against 56.2 at 1 MiB.

Against a backend that sends a content-length in one write, a chunked backend costs more than that, and most of the extra is how it writes, not the chunk framing. At 8 KiB chunks the whole difference is +16.3% and +39.5%, of which the write pattern alone is +10.4% and +28.2% (64% to 72% of the cycles): more reads and wake-ups, kernel time. The write-pattern row is outside the comparisons named before the run, but the same figure follows from the two Measured rows above it (at 64 KiB, 1.163 / 1.054 = 1.104).

The part a code change could address is a copy. In one profile per configuration at 1 MiB, a C-library leaf called from the HTTP/1 parser takes 5.5% of worker cycles with chunked bodies and 0.0% in the control, where the body is moved as whole slices. The library symbol is not resolved in the profile, so “copy” rests on the v1.40.2 source (the copy branch of the HTTP/1 codec’s bufferBody) and on the contrast between the two configurations, not on a symbol name. The profile accounts for about 7.4 of the 8.0 points by which user cycles rise; the copy itself is 5.5 of them. The difference is about 0.26 user cycles per body byte. A patch that removes the copy was measured later and is under our 3% line: Chunked bodies without the copy.

Limits. At 1 MiB, 79% of the reference’s cycles are kernel time on loopback; only the user part carries over to other machines. Per body byte between the two sizes: 2.03 cycles [2.02, 2.05] with a content-length in one write, 2.72 in 8 KiB writes, 2.98 chunked at 8 KiB and 4.35 chunked at 4 KiB.

Per-connection buffer limit: pauses, resumes and epoll_ctl

Row Traffic Price or count Basis
Per-connection buffer limit of 32 KiB on the listener and the upstream cluster, against the default 64 KiB proxied, 2,000 req/s +19.02% [+17.86, +20.18] (+141.4k cycles: user +52.9k, kernel +88.5k) Measured
Upstream read pauses and resumes per response, from Envoy’s counters same 1.99 pauses and 1.00 resumes with the limit; none at the default Measured
epoll_ctl calls per response; all syscalls per response same 0 to 8.0; 10.0 to 23.5 Measured [mechanism]
4 KiB limit: epoll_ctl; all syscalls 16 KB proxied 0 to 12.0; 9.5 to 24.5 Measured [mechanism]
32 KiB limit: epoll_ctl; all syscalls 1 MiB proxied 4.0 to 67.9; 28.6 to 153.3 Measured [mechanism]
  • Each count pair reads from the default to the limit.
  • The 4 KiB row is the configuration of the +20.6% settings row; with the limit a response had 2.00 pauses and 1.98 resumes.
  • The 1 MiB row has no price. Its syscalls rose 5.4 times, with 17.0 pauses and 16.0 resumes per response (default: 1.0 pause and 1.0 resume).

Conditions: an nginx origin, the same-build check +0.54% [−0.41, +1.50]. The client reads at full speed.

A 32 KiB buffer limit makes a 64 KiB response 19% more expensive (+19.0% [17.9, 20.2]). Each pause and each resume costs 2 to 3 epoll_ctl calls. None of them is a modify: every call is one half of an add and delete pair. In one profile from a pre-run check, readDisable takes 5.5% of worker cycles at 32 KiB on 64 KiB responses, of which 3.8 points are kernel time; the epoll_ctl subtree is 2.7%. A change that keeps the registration across a pause has not been built or measured.

Not covered: slow clients and small HTTP/2 stream windows.

Syscalls per streamed event

Per event HTTP/1.1 response stream, 200-byte events Basis
All syscalls 4.55 Measured [mechanism]
readv 2.00, of which 1.00 returns EAGAIN Measured [mechanism]
sendto 1.00 Measured [mechanism]
epoll_wait 1.55, of which 0.89 with a zero timeout Measured [mechanism]
epoll_ctl, writev 0 Measured [mechanism]
CPU cycles 74k to 76k (75.6k [70.4k, 80.7k]), 72% of them in the kernel Measured, as a level
The two calls that carry no data, as a share of those cycles about 8% to 9% (range 7 to 11) Exploratory
  • 200-byte events 1 ms apart, one origin write per event, 20 or 200 events per response, 41,600 events per second in both. A per-event figure is the difference between the two kinds of response divided by 180.
  • Both kinds of streamed response failed their same-build check: −1.68% [−3.82, +0.52] with 20 events and −1.66% [−7.70, +4.77] with 200, which is 1.69 and 1.68 log points against a limit of 1.5. Comparisons of configurations on them have no verdict. We then applied a three-times rule: a claim stands only when its effect is at least three times that excursion (5.07 and 5.04 log points). The cycles per event pass it as a level, to about ±2k cycles; so do the instruction counts.
  • With 200 events, one valid run measured 17.3M cycles per request against 15.0M to 15.4M in the others, with the same instruction counts. We do not know why. We kept the run.
  • The counts come from single runs under a tracer. The zero-timeout count (0.89) was taken at 57% to 66% busy under the tracer; the priced runs ran at 37% to 50%.

A streamed event costs Envoy about the same syscalls as a small message relayed by tcp_proxy, and the same two of them carry no data: a read that returns EAGAIN and a wait with a zero timeout. The counts are measured. The price of the two calls is an estimate from one kernel profile, on this 2016 Xeon with page-table isolation, between two bounds fixed before the run that came out far apart (3.5% and 15.4% per event). No patched build has been measured on a streamed response.

On the relayed message and on a proxied request, a later session (the night of 23 to 24 November 2026) measured the two calls by removing each with an experimental patch, inside one experimental build:

Item Traffic Price Basis Conditions
Two empty kernel calls per relayed message (an empty read, a zero-timeout poll) TCP relay (tcp_proxy), 64-byte messages, 8,000 req/s 12.5% of CPU cycles per message [11.1, 13.8], which is 9.4k of 75.0k cycles; 11.0% [9.7, 12.3] against the official binary. The empty read alone 8.0% [6.0, 10.1]; the poll alone not resolved (about 3%) Measured (12 paired rounds, against the same build with both changes off); the figure against the official binary is Exploratory Envoy v1.40.2 with an experimental patch; loopback; one 2016 Xeon with page-table isolation; plain TCP; no bulk transfer; under multiplexed load both changes together send 17% to 19% more often (CPU not measured there)
The same two calls on a proxied request HTTP/1.1, 4 KB response, 5,200 req/s 3.1% [2.3, 3.9], which is 16.3k of 528k cycles per request; 2.4% [1.6, 3.3] against the official binary Measured; the figure against the official binary is Exploratory as above

Syscalls per relayed message went from 4.88 to 2.96 with both changes on (one run per configuration under a tracer, Measured [mechanism]). The profile estimate for the relayed message was about 9% (range 7 to 11); the measurement is at or just above the top of it. This is an experiment, not a proposed change. The larger half, the change that removes the empty read, depends on a change to the libevent library bundled with Envoy and is not suitable for upstream in this form. With both changes on, a relay whose connections carry several messages at once (HTTP/2 over 16 connections) made 17% to 19% more send calls per message; those counts come from single traced runs, and the CPU effect was not measured. The rows hold for 64-byte messages and 4 KB responses only, over loopback, on one 2016-era server with page-table isolation, where a kernel call is dearer than on a current CPU; no bulk transfer was measured. The experiment is two commits on v1.40.2, each behind its own runtime guard, on We-Amp’s Envoy fork as the branch experiments/relay-syscalls and, in the state that was measured, as the tag relay-syscalls-2026-11/v1. The rows per change, the checks and the send-call counts are in What a second Envoy hop costs in CPU.

The data for the sections of 23 November (Features that are on and take no action, Bodies, buffers and streams, the later rows under Default idle timeouts and A deferred OpenTelemetry span at 0% sampling) and for the experiment rows of the night of 23 to 24 November is in the harness repository at tag waves-2026-11d: the configurations in examples/wave7s3 (features and idle timeouts), examples/wave7s2 (bodies, buffers and streams), examples/wave7s4 (the deferred span) and examples/wave7s5 (the experiment rows), the run notes in docs/wave-studies.md (bodies and streams, tracing, relay syscalls), and the raw data in the release archives waves-2026-11d-data-feature-stack.tar.gz, waves-2026-11d-data-bodies-streams.tar.gz, waves-2026-11d-data-tracing-tests-profile.tar.gz and waves-2026-11d-data-relay-syscalls.tar.gz (checksums in SHA256SUMS).

Connections and upstream protocols

What Envoy connections cost in CPU: handshakes, HTTP/3 and upstream HTTP/2 has these rows with their full conditions, the data and two unpriced observations on listener sockets. They come from sessions on 22 November 2026 with the official v1.40.2 binary on the same machine, 4 workers and loopback. The connection rows ran at one request per connection, 800 or 1,600 req/s, with the proxy 8% to 33% busy and Envoy’s default connection balancing; the upstream rows at 5,200 req/s on warm upstream connections; the HTTP/3 row at 2,000 req/s on 16 long-lived client connections, at low load. Arms and load differ from the settings table, so the rows do not compare with it one for one. Per-request intervals are the wider of the plain interval and the one with the between-session spread; cycle intervals are plain intervals over the rounds.

Row Price [95% interval] Basis
New plaintext HTTP/1.1 connection, against keep-alive 239k cycles [232k, 246k]; 240k in a second session Measured
New TLS 1.3 connection, ECDSA P-256 certificate 1,145k cycles [1,137k, 1,153k] Measured
New TLS 1.3 connection, RSA-2048 certificate 3,054k cycles [3,046k, 3,061k] Measured
RSA-2048 instead of ECDSA P-256, per full handshake +1,909k cycles [+1,900k, +1,917k] Measured
Key exchange X25519MLKEM768 (the default) instead of X25519 alone, ECDSA, per full handshake +149k cycles [+139k, +158k] Measured
Session resumption with ECDSA, every client resuming, against resumption off +0.7% per request [−0.1, +1.6], no measurable difference Measured
TCP_DEFER_ACCEPT of 1 s, plaintext, client sends its request at once −0.5% per request [−1.4, +0.3], no measurable difference Measured
HTTP/2 to the upstream instead of HTTP/1.1, both over TLS +5.1% [+4.3, +5.8] Measured
oghttp2 instead of nghttp2 +5.1% [+4.0, +6.2] with a cleartext HTTP/2 upstream; +8.7% [+6.3, +11.2] on both sides of a gRPC proxy Measured
Upstream TLS on warm connections, against plaintext to an nginx origin +2.9% [+2.0, +3.9] Measured
Mutual TLS on warm connections between two proxies +6.4% [+5.6, +7.2] of the pair Measured
grpc_stats with stats_for_all_methods: true, unary gRPC about +6% [+2.8, +9.5] (lower end inside the A/A reach) Measured
HTTP/3 instead of HTTP/2 over TLS, per request, long-lived connections about +75% [+72.2, +77.4], likely a little more at even worker load Measured

On 23 November 2026 one session repeated the HTTP/3 row and agreed with it (+77.6% [+73.3, +82.0], 6 rounds; the earlier figure lies inside the repeat’s interval). Another session that day priced a second hop that relays TCP and a Unix domain socket for a hop on the same host. The full account, with what a relaying hop gives up, is What a second Envoy hop costs in CPU: HTTP proxy against tcp_proxy. 4 KB proxied at 5,200 req/s on one host, 8 rounds; the first two rows have two proxies, the third has one:

Row Price [95% interval] Basis
Second proxy runs tcp_proxy instead of a minimal HTTP proxy −32.9% [−33.6, −32.3] of the pair’s CPU per request; −30.8% [−31.5, −30.1] with mutual TLS on that hop. The hop gives up per-request balancing, retries, HTTP stats and logs, and header policy Measured
Unix domain socket instead of loopback TCP between two proxies −6.0% [−6.8, −5.2] of the pair, both ends of the hop counted Measured
Unix domain socket instead of loopback TCP from the proxy to the origin −4.5% [−5.7, −3.3] of the proxy, its end of the hop only Measured

On 30 November 2026 one session priced exact connection balancing itself, under constant reconnects. Its reference is Envoy’s default listener, where the kernel spreads new connections over one listen socket per worker (reuse_port) and no balancer runs, not the exact_balance the rest of this list uses on both arms. The official v1.40.2 binary on the same 2016 server, 4 workers, HTTP/1.1, 4 KB proxied responses at 5,200 req/s, loopback. The request rate matches the settings rows; with reconnects the proxy’s load level may differ from their 25% to 33% busy, and this row quotes no figure for it. The load generator is the epl-client-2026-11/v2 build of our Nighthawk fork, adopted after a comparison on the same shape without reconnects; this reconnecting shape was not part of that comparison. Load-generator recipe: reconnect every 10 requests, with 512 client connections (16 client workers with 32 each) and the requests spread over them, so 520 new connections per second. 30 rounds in a balanced order, each leg in a freshly started proxy and paired across restarts, with the comparison fixed before the session. The check for evenly spread load was off for this session. The per-request interval is the wider of the plain interval and the one with the between-session spread:

Row Price [95% interval] Basis
exact_balance on the listener, against Envoy’s default balancing, reconnect every 10 requests (520 new connections/s) +1.2% per request [+0.4, +1.9]; one session, between 1% and 2%, and the interval still excludes zero once the between-session spread is added Measured (pre-registered)

A second copy of the same configuration, run in the same rounds as a check, read under the 1% line against Envoy’s default; the row stands as the comparison fixed before the session. Loopback has no RSS, no NIC queues and no interrupt steering, and on real hardware they decide part of where new connections land and how the load falls on each core. The session did not measure why the balancer costs CPU. The raw data are assets of the release.

External processing (ext_proc) and the gRPC client

Against the same proxy with no filter, 4 KB proxied responses at 5,200 req/s:

Filter gRPC client CPU per request [95% interval] Cycles added per request Basis
ext_authz, gRPC service (repeats the settings row, +80.7%) envoy_grpc +80.2% [+77.0, +83.4], a lower bound 423k Measured
ext_proc, default processing mode (request and response headers) envoy_grpc +99.7% [+93.8, +105.8], a lower bound 526k Measured
ext_proc, request headers only (response_header_mode: SKIP) envoy_grpc +79.0% [+76.3, +81.7], a lower bound 416k Measured
ext_authz, gRPC service google_grpc +150.3% [+145.1, +155.7], a lower bound 792k Measured
ext_proc, default processing mode google_grpc +167.4% [+162.1, +172.7], a lower bound 882k Measured
ext_proc, request headers only google_grpc +153.2% [+147.6, +158.9], a lower bound 807k Measured

Direct comparisons in the same rounds:

Comparison CPU per request [95% interval] Cycles per request Basis
ext_proc default mode against request headers only (the response-header round trip) +11.6% [+9.4, +13.9] +110k Measured
ext_proc request headers only against ext_authz gRPC −0.7% [−1.8, +0.4], no measurable difference −6k Measured
google_grpc against envoy_grpc, ext_authz +38.9% [+37.1, +40.7] +370k Measured
google_grpc against envoy_grpc, ext_proc default mode +33.9% [+31.5, +36.2] +356k Measured
google_grpc against envoy_grpc, ext_proc request headers only +41.5% [+39.7, +43.3] +391k Measured
Median latency, google_grpc against envoy_grpc +0.7 to +1.9 ms – Exploratory

Conditions:

  • One session on 21 November 2026: official v1.40.2, 4 workers, the machine, measure of CPU and connection balancing of the settings above. 6 rounds in a rotated order. The A/A copy ran next to its reference in 4 of the 6 rounds, so its reach may be slightly optimistic for arms that ran further apart. Every leg passed the validity gate with no check switched off; the A/A check gave −0.09% [−1.79, +1.65]. Intervals are the wider of the plain interval and the one with the between-session spread; here the plain one is the wider in every row.
  • The side services run on the other socket, with connections kept alive and the request body not sent: a static nginx gRPC responder for ext_authz and a minimal Go HTTP/2 (h2c) server that flushes once per message for ext_proc. Their own CPU is not included.
  • envoy_grpc is the proxy’s own gRPC client; google_grpc uses the gRPC C++ library.
  • With a filter on, the proxy ran busier than the reference at the same rate (median 54% to 61% against 31% with envoy_grpc, and 81% to 86% of its four cores with google_grpc). On this machine busier cores cost less per request, so every row against no filter is a lower bound. Loopback kernel cycles include part of the side service’s receive work: at most the kernel cycles each filter adds, 74k to 114k per request with envoy_grpc.

In its default mode ext_proc makes two round trips to its service per request, one for the request headers and one for the response headers. The first, 416k of its 526k cycles, costs the same as an ext_authz gRPC check; the second adds the remaining 110k. response_header_mode: SKIP therefore brings ext_proc to the cost of an ext_authz gRPC check and saves about 10% of the proxy’s CPU per request in default mode. Keep the default only if the filter needs the response headers. For an allow-or-deny decision the two filters cost Envoy the same against these two minimal services, so the choice can rest on features; your own service’s cost comes on top.

google_grpc cost 356k to 391k cycles more per request than envoy_grpc (+34% to +41%) with every filter. That extra, and more, ran on threads outside the workers: 404k to 442k cycles per request, about three quarters of it on the 16 event_engine threads the gRPC C++ library started on this machine, and the rest on Envoy’s per-worker google_grpc completion threads (GrpcGoogClient), which exist in every configuration and become busy with this client. The workers did 1% to 8% less work, because part of the gRPC work moved off them. The library’s 17 threads (16 event_engine, one lifeguard) run on the proxy’s own cores and preempt the workers: involuntary context switches of the workers rose from 50-76 to 43k-110k per 20 s window, and the four cores ran 81% to 86% busy while the busiest worker read 0.54 to 0.57 of a core. Median latency on loopback rose by 0.7 to 1.9 ms. Unless a filter needs a feature only google_grpc has, such as its credential plugins, use envoy_grpc.

Not measured: ext_proc with bodies, on the header-heavy shape, or in observability_mode.

Configuration updates over xDS

Update Main-thread cycles per update [95% interval] Main-thread task clock per update Basis
RDS: one route of 205 changed (the table is rebuilt) 12.68M [12.63M, 12.73M] 5.54 ms Measured
RDS: the same routes with a new version only 11.58M [11.54M, 11.62M] 5.05 ms Measured
CDS: one of 52 clusters changed, not the one carrying traffic 12.60M [12.56M, 12.64M] 5.50 ms Measured
CDS: the same clusters with a new version only 10.98M [10.88M, 11.08M] 4.79 ms Measured
CDS: the cluster carrying traffic changed, metadata only 12.70M [12.61M, 12.79M], and 9.9 [9.3, 10.5] new upstream connections per update 5.55 ms Measured
EDS: one host of 100 replaced 3.59M [3.56M, 3.62M] 1.57 ms Measured
Worker cycles per update, any of the above under about 55M – Not resolved
CPU per request at one update per second, any of the above no change beyond the A/A – Measured
Updates per second at which the main thread alone would fill one core (RDS or CDS, this size; linear, not measured) about 180 – Modelled

Conditions:

  • The session, machine, binary and traffic of the section above (official v1.40.2, 4 workers, 4 KB proxied at 5,200 req/s), 6 rounds, every leg valid.
  • State-of-the-world updates from watched JSON files: one route table of 205 routes, 52 clusters and one EDS cluster of 100 endpoints. One update per second: 20 of one resource type inside each 20 s window, every one accepted, none of another type. The reference runs the same configuration without updates.
  • The price is the main thread’s cycles in the window minus the reference’s, divided by 20, with plain 95% intervals over the 6 paired rounds. The time column is the main thread’s task clock.

At this size one RDS or CDS update costs about 5.5 ms of main-thread CPU, 96% of it in user space: about 0.6% of one core at one update per second, with no measurable cost per request. A resend with only a new version costs 91% (RDS) and 87% (CDS) of a changed update, because reading and comparing the update takes most of the time; the rebuild accounts for about 1.1M and 1.6M cycles. Deduplicating updates in the control plane therefore saves most of their main-thread cost. These files are JSON, and a gRPC control plane sends binary protobuf, so we expect these rows to be an upper bound for the parsing part; that was not measured. An EDS update that replaces one host costs about 1.6 ms. An endpoint change sent through CDS was not measured, so the EDS and CDS rows price different updates.

A change to the cluster that carries traffic, even to its metadata only, replaced the cluster and its connection pool: about 10 new upstream connections per update, against 0 for every other update. The proxy then held 8 to 10 upstream connections, against about 215 to 400 in the reference, whose pool keeps the connections it opened at start-up. A resend with only a new version opened none: Envoy compares a hash of the resource, for RDS as for CDS. A control plane should change a Cluster that carries traffic only on purpose. With TLS upstreams each reconnect is a new TLS connection; its cost was not measured.

The workers’ share was not resolved: every worker figure sits inside a noise of ±12M to ±42M cycles per update, so it is under about 55M. The A/A comparison also drifted a little (+0.51% per request; its plain interval just excludes zero, the interval with the between-session spread includes it). No safe update rate follows from this run. Larger configurations, a lower request rate, delta xDS and a gRPC control plane were not measured.

The data for this section and the one above is in the harness repository at tag waves-2026-11: the configuration in examples/wave1c, the run notes in docs/wave-studies.md and the raw data in the release archive waves-2026-11-data-ext-proc-xds.tar.gz (checksums in SHA256SUMS).

Stats sinks and stat updates

Conditions for the three sink rows: one session on 19 November 2026, separate from the settings, with the same machine, binary (official v1.40.2), worker count (4) and measure of CPU as the settings above. The proxy has 1,000 static clusters in every configuration, which gives it 118,396 stats, and flushes them every 5 s. The sinks receive on loopback and discard what they get; net.core.rmem_max was raised for the session, and the sink sockets were granted a 512 MiB receive buffer. 10 rounds, 4 KB proxied responses at 5,200 req/s: the reference was 30.7% busy, statsd 36.2%, dog_statsd 35.7% and OpenTelemetry 31.2%.

Setting (against the same configuration without it) Traffic CPU per request [95% interval]
statsd stats sink, UDP, one datagram per line 4 KB proxied, 5,200 req/s +19.69% [+18.70, +20.69]
dog_statsd stats sink, buffered at 1,432 bytes per datagram same +17.78% [+16.63, +18.93]
OpenTelemetry stats sink, OTLP over gRPC to a local collector same +1.66% [+0.69, +2.65], near the floor
Second copy of the reference (A/A) same −0.15% [−1.02, +0.73]
Every stat in the stats store rejected (stats_matcher with reject_all: true) small proxied request, 28 workers, 1,500 req/s per worker −1.98% [−2.95, −0.99] of worker cycles, a lower bound on what stat updates cost

Intervals in this section include the between-session spread, as in the stats post. Buffering batches the flush only; the workers still send each histogram sample as its own datagram, about 3.0 per request with either sink, which is why the two statsd-family rows are close. The OpenTelemetry figure is the flush spread over the requests at this rate, so it moves with the stat count, the rate and the flush interval.

The statsd row was measured again two days later, on 21 November, in the session of batched statsd datagrams: +19.4% [+18.5, +20.3] under the same conditions, 8 rounds. The two sessions agree within their intervals; each figure is quoted with its own session, and they are not pooled.

The last row is from a different run and a different measure: one session on 20 November, worker cycles per request, 15 rounds, the reference 36% busy, no sink. It is a lower bound because per-host counters and gauges stay on; they are outside the stats store. The same comparison at 14 workers and the same load has no verdict: the same-configuration repeat in those cells missed our 1% rule. The checklist’s router dynamic_stats: false row (−2.92%, total cycles at 4 workers, 29 November) is another setting, measured on another day; the stats post says how the two differ.

What Envoy’s stats cost in CPU: flushes, sinks and counters has the data and the rest: where the statsd cost sits, what a flush costs the main thread, flush and request latency and whether the cost of stat updates grows with workers. The store-stats row was also measured on arm64, on the release and on a build of unreleased main: Arm64 atomics in Envoy main and stats cost.

Kernel CPU-vulnerability mitigations

Comparison (default mitigations against mitigations=off, unless the row says otherwise) Machine Price per request Basis
4 KB proxied, keep-alive, 5,200 req/s 2016 Xeon (Broadwell), bare metal about +2.6% (+13.3k cycles), all in kernel cycles Measured
One request per connection, 1,600 req/s 2016 Xeon (Broadwell) about +3.8% (+32.2k cycles; an exploratory estimate of 12k to 14k more per new connection) Measured
Direct response with 109 headers, 8,000 req/s 2016 Xeon (Broadwell) about 2%, at the edge of what this setup resolves Not resolved
One request per connection, 1,600 req/s 5th-generation Xeon (Emerald Rapids), cloud VM about 2% or less (an upper-side reading: the boot without mitigations ran at the lowest clock) Not resolved
4 KB proxied and the direct response with many headers 5th-generation Xeon (Emerald Rapids) no number: boots with identical settings differed by up to about 3% Not resolved
Indirect branch speculation restricted for Envoy (per process, mitigations on, within one boot) 2016 Xeon (Broadwell) +2.9% [+2.4, +3.5], almost all in user space Measured
Speculative Store Bypass disabled for Envoy (per process, mitigations on, within one boot) 2016 Xeon (Broadwell) about 1% Measured
Indirect branch speculation restricted for Envoy (per process, mitigations on, within one boot) 5th-generation Xeon (Emerald Rapids) about 4% Measured
Speculative Store Bypass disabled for Envoy (per process, mitigations on, within one boot) 5th-generation Xeon (Emerald Rapids) about 2% Measured

Conditions:

  • Boot-level design. The 2016 server was booted three times, twice with the kernel’s default mitigations and once with mitigations=off; the cloud VM twice each way. Within each boot the usual paired runs ran. Each price compares the two boots with mitigations on with one boot without; on the VM that is a different off boot per traffic shape, fixed by rule before the second one ran. mitigations=off applied to the whole machine, the client and the origin included.
  • Intervals. Each price rests on three boots, which give one degree of freedom for the spread between boots, so the boot-level rows carry no confidence interval; the within-boot intervals from these runs are not intervals for a boot effect. On the 2016 server the two boots with mitigations on agreed within 0.4%. The per-process rows compare two configurations within one boot and carry ordinary intervals where one is given.
  • Traffic. Official v1.40.2, 4 workers, HTTP/1.1 over loopback, 4 KB proxied responses or a direct response with 109 headers, at the moderate fixed rates in the table. On the 2016 server that is about 17% busy with one request per connection and 26% to 31% on the other shapes; the faster VM ran the same rates at about 5% to 12% busy.
  • The 2016 server is the machine of this list. It needs page-table isolation, CPU buffer clearing and retpolines.
  • The current CPU is a cloud VM on a 5th-generation Intel Xeon (Emerald Rapids), with the client and origin in the same VM. It needs none of those three; what remains are the Spectre v1 barriers and indirect-branch protections, largely handled in hardware. The host’s own mitigations stayed on throughout, and the VM’s clock speed varied between runs.

On the 2016 server the extra cost is all kernel time: Envoy’s kernel cycles rose by about 9% to 10% while its kernel instruction count rose by under 1%. User-space work was unchanged. This fits what these mitigations do: a few slow operations on every kernel entry and exit, not more work. Two caveats: on loopback, part of the client’s and origin’s network processing is counted as Envoy’s kernel time, and mitigations=off applied to them too, so the kernel figure belongs to this setup, not to a deployment behind a network card.

On the current CPU, with one request per connection, the default mitigations cost Envoy less: about 2% or less, an upper-side reading because the VM’s clock varied between boots, against about 3.8% on the 2016 server. For keep-alive proxied requests and for direct responses with many headers we give no number, because boots with identical settings differed by as much as the effect and the clock speed varied between runs. We saw no resolved rise in user-space cycles and no measurable rise in kernel instruction counts. The two machines differ in more than the CPU (bare metal against a VM, and the same rates at a much lower busy share), so the comparison is between two rigs.

We do not recommend turning mitigations off.

The data for this section is in the harness repository at tag waves-2026-11c: the configurations in examples/wave5h (the 2016 server) and examples/wave6k (the cloud VM), the run notes in docs/wave-studies.md (cloud VM) and the raw data in the release archives waves-2026-11c-data-mitigations.tar.gz and waves-2026-11c-data-mitigations-cloud.tar.gz.

Releases

Thirteen official release binaries, each checked against its published digest: the newest patch of seven release lines that started between October 2024 and October 2026 (v1.32.13, v1.34.14, v1.36.13, v1.37.11, v1.38.9, v1.39.6 and v1.40.2), the first release of three of those lines (v1.37.0, v1.38.0 and v1.40.0), and three v1.38 patch releases in between (v1.38.2, v1.38.5 and v1.38.7). The same test machine as the settings above, with pinning and idle states checked on every run; 4 workers evenly loaded; HTTP/1.1 over loopback, no TLS. Two shapes, each at two load levels: 4 KB proxied at 5,200 req/s (about 31% busy) and 12,000 req/s (about 60%), and a 128-byte direct response whose route adds 52 response headers (it also lists 57 request headers, which a direct response never applies) at 8,000 req/s (about 26%) and 18,400 req/s (51% to 55%). At the higher load level the load generator raises its rate over its first second, because at full rate from the start its connection pool overflowed. In the second session the end of that ramp fell inside the measurement window (0.3% fewer requests than the target there, the same in every run); in the third the window started after it.

Three sessions in November 2026, each in its own rotated order. The first compared three releases at the lower load. The second compared six releases at both loads (14 rounds). The third compared seven releases at both loads (32 rounds), with the comparison of v1.38.0 against v1.37.11 named before it ran. It was followed by two shorter runs at the higher load only: the v1.38 patch releases one by one (20 rounds), and a hardware-counter run (24 rounds). In the second and third sessions a second copy of v1.40.2 ran in the same rounds as the A/A check; the two shorter runs had none.

Chart: on a header-heavy direct response, Envoy v1.40.2 used 3.4% to 7.2% less CPU per request than each of seven earlier releases.Dots with 95% intervals, one row per release in release order, on an axis from −8% to +4%; left of zero, v1.40.2 costs less per request. A grey band from −1% to +1% marks changes under 1%, below what one session can tell from noise. v1.32.13: −7.2%, interval −8.2 to −6.2; v1.34.14: −3.4%, interval −4.5 to −2.3; v1.36.13: −3.4%, interval −4.4 to −2.4; v1.37.11: −3.4%, interval −4.0 to −2.8; v1.38.0: −4.7%, interval −5.3 to −4.2; v1.38.9: −4.3%, interval −4.9 to −3.7; v1.39.6: −6.0%, interval −6.6 to −5.4. The first three rows are from the second session, the others from the third.Header-heavy direct response, 8,000 req/s (about 26% busy)Under 1%: below what one session can tell from noise−8%−6%−4%−2%0+2%+4%v1.40.2 cheaperv1.40.2 dearersecond sessionthird sessionv1.32.13: −7.2% [−8.2, −6.2]v1.32.13−7.2%v1.34.14: −3.4% [−4.5, −2.3]v1.34.14−3.4%v1.36.13: −3.4% [−4.4, −2.4]v1.36.13−3.4%v1.37.11: −3.4% [−4.0, −2.8]v1.37.11−3.4%v1.38.0: −4.7% [−5.3, −4.2]v1.38.0−4.7%v1.38.9: −4.3% [−4.9, −3.7]v1.38.9−4.3%v1.39.6: −6.0% [−6.6, −5.4]v1.39.6−6.0%Chart: on a header-heavy direct response, Envoy v1.40.2 used 3.4% to 7.2% less CPU per request than each of seven earlier releases.Dots with 95% intervals, one row per release in release order, on an axis from −8% to +4%; left of zero, v1.40.2 costs less per request. A grey band from −1% to +1% marks changes under 1%, below what one session can tell from noise. v1.32.13: −7.2%, interval −8.2 to −6.2; v1.34.14: −3.4%, interval −4.5 to −2.3; v1.36.13: −3.4%, interval −4.4 to −2.4; v1.37.11: −3.4%, interval −4.0 to −2.8; v1.38.0: −4.7%, interval −5.3 to −4.2; v1.38.9: −4.3%, interval −4.9 to −3.7; v1.39.6: −6.0%, interval −6.6 to −5.4. The first three rows are from the second session, the others from the third.Header-heavy direct, 8,000 req/s, about 26% busy−8%−6%−4%−2%0+2%+4%v1.40.2 cheaperdearerv1.32.13: −7.2% [−8.2, −6.2]v1.32.13−7.2%v1.34.14: −3.4% [−4.5, −2.3]v1.34.14−3.4%v1.36.13: −3.4% [−4.4, −2.4]v1.36.13−3.4%v1.37.11: −3.4% [−4.0, −2.8]v1.37.11−3.4%v1.38.0: −4.7% [−5.3, −4.2]v1.38.0−4.7%v1.38.9: −4.3% [−4.9, −3.7]v1.38.9−4.3%v1.39.6: −6.0% [−6.6, −5.4]v1.39.6−6.0%
Chart: on a 4 KB proxied response, Envoy v1.40.2 used about the same to 2.4% more CPU per request than seven earlier releases.Dots with 95% intervals, one row per release in release order, on an axis from −8% to +4%; left of zero, v1.40.2 costs less per request. A grey band from −1% to +1% marks changes under 1%, below what one session can tell from noise. v1.32.13: about +1%, not resolved, no interval; v1.34.14: +2.4%, interval +1.7 to +3.0; v1.36.13: +2.0%, interval +1.3 to +2.7; v1.37.11: +1.4%, interval +1.0 to +1.8; v1.38.0: under 1%; v1.38.9: under 1%; v1.39.6: under 1%. The first three rows are from the second session, the others from the third.4 KB proxied, 5,200 req/s (about 31% busy)Under 1%: below what one session can tell from noise−8%−6%−4%−2%0+2%+4%v1.40.2 cheaperv1.40.2 dearersecond sessionthird sessionv1.32.13: about +1% (+1.0%; +1.2% in the first session), not resolvedv1.32.13about +1%, not resolvedv1.34.14: +2.4% [+1.7, +3.0]v1.34.14+2.4%v1.36.13: +2.0% [+1.3, +2.7]v1.36.13+2.0%v1.37.11: +1.4% [+1.0, +1.8]v1.37.11+1.4%v1.38.0: under 1% (below what one session can tell from noise)v1.38.0under 1%v1.38.9: under 1% (below what one session can tell from noise)v1.38.9under 1%v1.39.6: under 1% (below what one session can tell from noise)v1.39.6under 1%Chart: on a 4 KB proxied response, Envoy v1.40.2 used about the same to 2.4% more CPU per request than seven earlier releases.Dots with 95% intervals, one row per release in release order, on an axis from −8% to +4%; left of zero, v1.40.2 costs less per request. A grey band from −1% to +1% marks changes under 1%, below what one session can tell from noise. v1.32.13: about +1%, not resolved, no interval; v1.34.14: +2.4%, interval +1.7 to +3.0; v1.36.13: +2.0%, interval +1.3 to +2.7; v1.37.11: +1.4%, interval +1.0 to +1.8; v1.38.0: under 1%; v1.38.9: under 1%; v1.39.6: under 1%. The first three rows are from the second session, the others from the third.4 KB proxied, 5,200 req/s, about 31% busy−8%−6%−4%−2%0+2%+4%v1.40.2 cheaperdearerv1.32.13: about +1%, not resolvedv1.32.13about +1%v1.34.14: +2.4% [+1.7, +3.0]v1.34.14+2.4%v1.36.13: +2.0% [+1.3, +2.7]v1.36.13+2.0%v1.37.11: +1.4% [+1.0, +1.8]v1.37.11+1.4%v1.38.0: under 1%v1.38.0under 1%v1.38.9: under 1%v1.38.9under 1%v1.39.6: under 1%v1.39.6under 1%
CPU per request of the official v1.40.2 binary against each earlier release, at the lower load level only (the table below has both). Left of zero, v1.40.2 costs less. Dots are means with 95% intervals; the hollow dot for v1.32.13 is about +1%, not resolved after correction for multiple comparisons, so it has no interval. Rows under 1% sit in the grey band without a dot: one session cannot tell them from noise. Above the dashed line, the second session (14 rounds); below it, the third (32 rounds). One 2016 two-socket Xeon server, 4 workers evenly loaded, HTTP/1.1 over loopback, no TLS. Hover or tap a row for its figures.

CPU per request, v1.40.2 against each earlier release, lower load / higher load:

v1.40.2 against Header-heavy direct response 4 KB proxied
v1.32.13 −7.2% [−8.2, −6.2] / −7.8% [−8.6, −7.1] about +1%, two sessions (+1.0%; +1.2% in the first) / about +1% to 2% (+1.3%, not resolved; +2.0% [+1.6, +2.5] in the exploratory counter run)
v1.34.14 −3.4% [−4.5, −2.3] / −3.7% [−4.2, −3.1] +2.4% [+1.7, +3.0] / +2.0% [+1.2, +2.8]
v1.36.13 −3.4% [−4.4, −2.4] / −3.4% [−4.5, −2.3] +2.0% [+1.3, +2.7] / +1.4%, not resolved
v1.37.11 −3.4% [−4.0, −2.8] / −2.5% [−3.1, −1.9] +1.4% [+1.0, +1.8] / under 1%
v1.38.0 −4.7% [−5.3, −4.2] / −4.9% [−5.4, −4.4] under 1% / under 1%
v1.38.9 −4.3% [−4.9, −3.7] / −3.7% [−4.2, −3.2] under 1% / under 1%
v1.39.6 −6.0% [−6.6, −5.4] / −5.9% [−6.5, −5.4] under 1% / under 1%

The first three rows are from the second session, the others from the third. v1.37.11 and v1.38.9 were in both, and their rows agreed within the spread between sessions (the largest moves, both on the header-heavy shape: v1.37.11 at the lower load, −2.7% in the second session, and v1.38.9 at the higher load, −4.5%). “Not resolved” means not significant once corrected for the number of comparisons. “Under 1%” is below what one session can tell from noise.

  • The header-heavy direct response got about 7% cheaper from v1.32.13 to v1.40.2, at both load levels, in every round, in two sessions (−6.3% and −7.2% at the lower load). The saving came in two steps, the first by v1.34.14 and the second with v1.40.0. In the second session about half of it was in place by v1.34.14, with v1.36.13 the same; the first version of this list, which did not measure v1.34.14, put about three quarters of it in v1.36.13, so the size of the first step is not pinned down. In between, the cost went up twice. The v1.38 line cost about 1% to 2.5% more than v1.37.11, already in v1.38.0 (the comparison named before the run: +1.4% and +2.5%). v1.39.6 cost about 2% more than v1.38.9.
  • On this machine, proxied requests did not get cheaper. v1.40.2 costs about 1% more than v1.32.13 at the lower load (+1.2% and +1.0% in two sessions, at the limit of what this setup resolves). It costs about 2% more than v1.34.14, the cheapest release on this shape, at both load levels. About half of the rise since v1.34.14 was in place by v1.37.11. The largest rise between two consecutive release lines was from v1.37.11 to v1.38.9: about 1% to 2% in two sessions, with user-space instructions per request up about 4%. The published binaries do not place it in one release: v1.38.0 against v1.37.11, and each v1.38 patch release against the one before (measured at the higher load), stayed under 1%. A 16 KB proxied shape, measured in the first session only, moved with the 4 KB shape (+1.3% [+0.9, +1.7] against v1.32.13). The comparison is between the official binaries, not between the sources.
  • Patch releases did not change the cost by 1% or more in a way that repeated. This was checked two ways: the first against the newest patch of three lines (v1.37.0 and v1.37.11, v1.38.0 and v1.38.9, v1.40.0 and v1.40.2) on both shapes and both loads, and the v1.38 patches one by one at the higher load. Readings of 1% or more came up only on the header-heavy shape within v1.38, and none held: a 1.3% saving across the v1.38 patches in the third session did not repeat in the one-by-one run, and the one patch step of that size there (v1.38.2 to v1.38.5) was undone by the next patch. On proxied requests at the higher load the v1.38 patches added about 0.8% in both runs, under what one session can tell from noise.
  • Instructions are not a stand-in for cost across releases. From v1.32.13 to v1.40.2, user-space instructions per request fell 12% (proxied) and 29% (header-heavy), measured to a few hundredths of a percent. On proxied requests the cycles did not fall with them: user-space instructions per cycle went from 0.55 to 0.48. v1.39 and v1.40 cut proxied instructions by 4% and 2% without changing cycles by 1% or more. Hardware counters on this processor did not single out a cause of the v1.38 step. The binary grew from 90.5 to 101.7 MB with v1.38.0, about 7 MB of that in machine code, and by under 0.5 MB in the patches after it.

How this section is kept: the table is updated when we measure a new release. A new entry is measured the same way, the first release and the newest patch of a line against v1.40.2, with an A/A copy of v1.40.2 in the same rounds; other patch releases get a size and section check only. Entries are anchored on re-measured releases: a session on a different machine first re-measures the releases from v1.37.0 on against v1.40.2, and its rows are shown next to these, not merged with them. The protocol is in RELEASE-RECORD.md, and the data and the binaries’ digests are in data/release-record/ of the harness repository.

The first version of this list said this question needed a second load level and a second machine. The second load level is measured here. A second machine has not been measured for the releases.

Surplus worker threads in a container pod

Conditions: a single-node Kubernetes cluster on the same bare-metal machine, the node confined to one socket (20 cores, 40 hardware threads), the official v1.40.2 container image, a pod requesting 2 CPUs with no CPU limit. Traffic is HTTP/1.1 over 512 client connections to a 2-byte direct response, with no upstream. The client reaches the pod through the container bridge and a host port, so the absolute CPU per request includes that kernel work. CPU in this section is the pod’s CPU time from the kernel’s accounting, not cycles. Each run had to reach its rate within 1% at the client and at the proxy, with zero client overflow, at least 25% client headroom and no other work on the client’s CPUs. The two-worker pod’s workers were about 17% busy at 2,000 requests per second and about 40% busy at 8,000. The kernel spread the connections over the workers; no connection balancer was configured. 12 paired rounds in balanced order unless stated.

A proxy pod that requests CPU but sets no CPU limit starts one worker thread per CPU the node lets it use, not one per requested CPU: in v1.40.2 the default worker count is the smallest of the hardware threads, the CPU affinity and the cgroup CPU limit, and a CPU request sets none of these. On a 40-CPU node, a pod requesting 2 CPUs started 40 workers.

Each surplus worker costs CPU while idle (about 0.4 ms of CPU per second with the machine’s default idle settings) and about 70 KB of memory. At low load that idle cost is the whole difference: +5% CPU per request at 2,000 requests per second (95% interval +3% to +8%), with no latency difference.

At higher load, most of what the surplus workers cost on this machine came from its idle-state settings. At 8,000 requests per second over 512 connections, so that every worker took traffic, CPU per request was about 44% higher and median latency 43% to 46% higher than with two workers, in two sessions, with the machine’s default idle settings. Both pods ran almost the same instructions per request (the 40-worker pod about 1% more). The 40-worker pod ran them more slowly: between requests its cores entered the deepest idle state several times as often. With every idle state deeper than the shallowest one disabled on the pod’s CPUs (4 paired rounds per condition), the difference fell to about 8% (95% interval +3% to +13%) in CPU per request and about 3% (+0.5% to +6%) in median latency. Disabling those states also keeps the processor package out of its deep idle states, so the two are not separated here. Power was not measured, and this is not advice to disable idle states. Measured on one machine with one Envoy release.

The percentages are against a near-empty request. The absolute penalty on this machine, about 45 µs of CPU per request with default idle settings and about 7 µs with deep idle states off, would be a smaller share of a request that does TLS, routes to an upstream and runs real filters.

Setting --concurrency to the CPU request, setting a CPU limit, or giving the pod dedicated CPUs brings the count down.

What 4 and 8 workers cost against Envoy’s own choice once a CPU limit is set is measured in Envoy –concurrency under a CPU limit.

The data for this section is in data/worker-count/ of the harness repository.

Upstream connection reuse order (experimental)

This row prices a code change, not a setting: an experimental patch to v1.40.2 (branch exp/upstream-pool-lru of We-Amp’s Envoy fork) that makes the upstream HTTP/1 connection pool reuse the least recently freed connection instead of the most recently freed one.

Conditions: the patched v1.40.2 build (one binary, the order chosen per process); 4 workers per proxy; the same bare-metal machine, clock and default idle states as above; loopback; plaintext HTTP/1.1; 4 KB proxied responses; CPU as total cycles of the proxy processes; exact connection balancing (exact_balance) on both listeners, so each new connection goes to the worker with the fewest. The order was switched on the first proxy only. Nothing closed a connection during the main runs, so a peer that closes idle connections, the usual risk of reusing the least recently used connection, was not exercised. The check for evenly spread load was off for the second proxy, whose spread is the result. The patched build has no A/A run of its own.

Measured with one proxy forwarding HTTP/1.1 to a second proxy. The effect depends on how much larger the connection pool between them is than the load needs.

Pool much larger than the load needs (512 connections left by one traffic spike, a handful in use). With the default order the first proxy sent nearly all requests over a few connections, and the second proxy’s workers shared the load unevenly: the busiest worker did 36% to 100% of the work, differently on every start, and in some runs reached a full core while that proxy as a whole was 30% to 55% busy. With least-recently-freed reuse the busiest worker did 25% to 27% of the work in every run. The price was +3.4% [+2.0, +4.8] CPU per request for the two proxies together at about 30% busy and +1.4% [+0.2, +2.6] at about 42% busy (repeat run: +3.6% [+2.2, +5.0] and +1.7% [+0.5, +3.0]). The two figures at 42% busy are in the 1% to 2% range: they have the same sign in both runs, and with the between-session spread added their intervals are [+0.1, +2.7] and [+0.4, +3.1].

Pool grown with the load (18 to 48 connections). The default order was already close to even: the busiest worker did 26% to 39% of the work and none came near a full core. Least-recently-freed reuse narrowed that to 25% to 29% and made latency a few percent worse. It did not change CPU per request by an amount this setup resolves: +0.6% [+0.1, +1.2] at about 30% busy and +0.1% [−0.4, +0.6] at about 42% busy, both under 1%, and with the between-session spread added both intervals include zero ([−0.2, +1.5] and [−0.7, +0.9]). With a limit of 1,000 requests per connection on the second proxy, the two orders spread the load equally (busiest worker 26% to 28%).

On a proxy whose upstream is a web server rather than another proxy, the change cost nothing measurable in CPU (+0.1% [−0.5, +0.7] at about 30% busy and +0.3% [−0.5, +1.1] at about 42% busy). All figures were measured on loopback; their size on a real network is not known. Least-recently-freed reuse keeps every pooled connection in use, so the pool does not shrink after a spike.

After a brief stall of the second proxy under steady traffic. The second proxy was paused for 40 ms, and the first proxy’s pool grew from about 30 to about 500 connections. Additional conditions: one rate (about 30% busy), one stall, two minutes observed after it, one session.

With the default order, the second proxy’s busiest worker then did 54% of the work (34% to 66% across runs, against 34% before the stall) for the full two minutes, and the pool stayed at its peak. Least-recently-freed reuse kept the load even throughout (busiest worker 25% to 26%). It cost about +1.2% CPU per request for the two proxies together [+0.3, +2.2], with the interval widened by the between-session spread. That is less than with the pool left by a start-up spike above.

Three existing settings on the first proxy compare as follows:

  • max_connection_duration of 30 s brought the load back to the level of a pool that fits the load (busiest worker 28% to 33%) 30 s after the stall in every run, and shrank the pool. Over the same two minutes the two proxies used about 2.5% more CPU per request than with the default order [+1.5, +3.5], with the interval widened by the between-session spread. That is a comparison over this window, not a steady price of the setting.
  • max_requests_per_connection of 1,000 took 80 to 100 s, with one worker briefly near a full core in some runs.
  • idle_timeout of 5 s shrank the pool within seconds, but the load evened out only slowly, and not in every run.

All figures are from one stall size, one rate and one value per setting, measured on loopback.

The configurations are in examples/upstream-pool-lru/ and the data in data/upstream-pool-lru/ of the harness repository.

Patches we measured

The rows in this section price code of our own. It is not part of any Envoy release and has not been reviewed by the Envoy project; read each figure as what the change was worth on this rig. The upstream connection reuse order above is the first such row.

Batched statsd datagrams

The patch is two commits on v1.40.2, published as the tag statsd-batch-2026-11/v2 of We-Amp’s Envoy fork. The first connects each thread’s UDP socket for the statsd sinks; it is on by default, behind a runtime guard. The second adds an opt-in max_bytes_per_datagram field to the plain statsd sink: when it is set, the histogram samples a thread records in one event-loop iteration, and the counters and gauges of each flush, go out newline-separated in datagrams of at most that size, as dog_statsd and graphite_statsd already do for their flush. An official binary rejects the new field.

Comparison CPU per request [95% interval] Basis
Patched build with max_bytes_per_datagram: 512, against the official binary, both with the plain statsd sink about −8% [−9.2, −7.0] Measured
of which the worker threads (batched samples; thread split within the run) about −6.3 points Measured
of which the main thread (batched flush; thread split within the run; depends on stat count, flush interval and request rate) about −1.8 points Measured
Official binary, plain statsd sink, against no sink +19.4% [+18.5, +20.3] Measured
Patched build with the field, against no sink +9.8% [+8.5, +11.0] Measured
Second copy of the official binary with the sink (A/A) −0.2% [−1.0, +0.6] Measured

Conditions:

  • The same machine, measure of CPU and connection balancing as the settings above; 1,000 static clusters, a 5 s flush interval, 4 KB proxied responses at 5,200 req/s, 4 workers, the sink receiving on loopback, net.core.rmem_max raised for the session.
  • One session on 21 November 2026, 8 rounds, every arm in every position equally often. Every leg was valid and the receiver dropped no datagram. Intervals are the wider of the plain interval and the one with the between-session spread.
  • The patched arm differs from the official one in both binary and configuration, because the official binary rejects the field.
  • The official-binary row against no sink repeats a comparison from 19 November: the stats section has +19.69% [+18.70, +20.69] for it, from that session.

The patched build sent 1.20 datagrams per request against 4.21: worker samples fell from 3.01 to 1.00 per request and flush datagrams from 1.20 to 0.20, and the receiver counted the same number of metric lines from both builds. That removed about half of the sink’s cycles. The worker part is paid per request and is the more portable figure. The flush part is a cost per flush (about 31,000 datagrams every 5 s from 1,000 clusters) spread over 5,200 req/s, so fewer stats, a longer flush interval or a higher request rate shrink it, and more stats grow it.

What the figure does not say:

  • It covers both commits with the field set; the build without the field, which only connects the sockets, was not measured in this session.
  • Plain statsd only; the sample path of dog_statsd and graphite_statsd is unchanged.
  • The field is off by default. A receiver must accept several newline-separated metrics in one datagram, and one lost datagram loses up to 512 bytes of metrics.
  • With a connected socket, an unreachable receiver shows up as a refused send; the patch then sends the datagram once more. The receiver was up for the whole run, so that path was not exercised.
  • On loopback the delivery into the receiver’s socket is charged to the proxy’s kernel cycles. Behind a network card we expect the saving to be smaller.
  • It is CPU cycles per request of the proxy process, on one machine, one shape and one session, with our own build of v1.40.2 plus the two commits.

The data is in the harness repository at tag waves-2026-11: the configuration in examples/wave1-b, the run notes in docs/wave-studies.md and the raw data in the release archive waves-2026-11-data-statsd-batching.tar.gz, directory statsd-batching/v2-confirm/ (checksums in SHA256SUMS).

A deferred OpenTelemetry span at 0% sampling

This is a candidate patch of ours: two commits on v1.40.2, on We-Amp’s Envoy fork as the branch candidates/otel-deferred-span and, in the state that was measured, as the tag otel-deferred-span-2026-11/v1. It puts off building the span until a request is sampled, behind a runtime guard that is on by default in the patched build. (The branch r2/x16-otel-unsampled-skip in the list of patches in the harness repository is an earlier, different change: it skips attribute work on spans that are not sampled.)

Comparison 4 KB proxied, 5,200 req/s Header-heavy direct, 8,000 req/s Basis
Official binary, tracer at 0% sampling, against no tracer (the settings row: +6.7%) +6.70% [+5.51, +7.89] +8.40% [+6.88, +9.94] Measured
Patched build, tracer at 0%, against no tracer +3.62% [+2.36, +4.90]; which side of our +4% threshold: Not resolved +5.37% [+3.96, +6.80] Measured
Patched against official, both at 0%: what the patch saves −2.88% [−3.70, −2.06] (−16.2k cycles) −2.80% [−3.90, −1.67] Measured
Patched against official, both at 1% −2.13% [−2.95, −1.30] −3.36% [−4.36, −2.34] Measured
Control: patched build with the guard off, against official, both at 0% −0.10% [−0.94, +0.74] +0.01% [−1.37, +1.42] Measured; no difference resolved
Control: patched build without a tracer, against official without a tracer −0.24% [−1.21, +0.73] −0.73% [−2.39, +0.95] Measured; no difference resolved

Conditions that belong to every figure:

  • On the proxied shape the patch saves 2.1% to 2.9%, depending on which copy of the official configuration is the reference.
  • No sampler extension on the tracer. The 0% is random sampling at the HTTP connection manager. With a sampler extension that samples nothing, the patch does nothing.
  • W3C propagation with no incoming trace context. No child spans.
  • Envoy v1.40.2, 4 workers, HTTP/1.1 over loopback, one machine. One session on 23 November 2026, 8 rounds.
  • Same-build check (official at 0% against its second copy): −0.79% [−1.64, +0.08] proxied, +0.66% [−0.11, +1.44] header-heavy. Both pass, and both are close. Read the sizes in this table as good to about ±1 point, not to the tenth.
  • The login departure described under Features that are on and take no action applies to this session too.

Two later sessions measured a smaller saving on a different comparison. The table compares the patched build with the official binary. The later sessions compared the patched build with its runtime guard on against the same build with the guard off, at 0% sampling on the 4 KB proxied shape at 5,200 req/s. On 27 November 2026 that read −1.86% [−2.57, −1.15] (48 rounds), and on 30 November 2026 −2.05% [−2.76, −1.34] (18 rounds). Both intervals exclude the −2.88% in the table, and both overlap the table’s interval [−3.70, −2.06]. The control row above gives the difference between the two comparisons in the first session: −0.10% [−0.94, +0.74], so none was resolved, and a difference of up to about 0.9 points is not excluded. The later sessions also used different load-generator settings, and we did not test whether those change the saving. The gap of about 1 point is open. We have not found its cause. The table row stands as measured in its session, the figures are not pooled, and the later readings sit at the edge of the ±1 point above. The session of 30 November also measured this at two other request rates: Envoy CPU per request under load: does a price hold at every request rate?.

With the OpenTelemetry tracer configured and nothing sampled, the patch lowered the tracer’s cost on a 4 KB proxied HTTP/1.1 request from about +6.7% to about +3.6% of CPU cycles per request (95% interval of the remainder +2.4 to +4.9). That is a saving of about 2% to 3% of the request: about 45% of the tracer’s cost at 0% on the proxied shape (38% against the second copy of the official configuration) and 36% on the header-heavy shape. Conditions: Envoy v1.40.2, 0% random sampling, no sampler extension and no incoming trace context. The saving is 13.8k user cycles per request; on loopback the kernel is about a third of the request, and that share sets the percentage.

Not resolved: before the run we set a threshold, that the patched build should cost no more than +4% over no tracer. The point estimate is 0.38 points under it. That gap is smaller than the difference between the two copies of the official configuration in this run (0.79), and the interval crosses the threshold. We did not re-run it. A second form of the same threshold changes side with the reference copy: 3.07 points recovered against one, 2.24 against the other, with the threshold at 2.7.

What the checks showed. At 0% sampling a profile of the patched build finds no span-building code with the guard on, and finds it with the guard off. At 100% sampling the official and the patched binary each exported 2,880 spans to the collector, with the same name, kind, status and attributes in the same order; only the build’s version string differs. Not compared: spans with an incoming trace context, child spans and a sampler extension. In user instructions per request, the tracer at 0% adds 21.3k on the proxied shape and the patched build 12.9k (Exploratory). What the remaining cost is made of was not profiled, and we claim no breakdown.

Known follow-ups before the patch could be proposed anywhere, and they are ours: a size limit on its list of pending tags and events, which is unbounded and does not merge repeated keys, and squashing the two commits. The patch is not part of any Envoy release and has not been reviewed by the Envoy project.

Chunked bodies without the copy

This patch of ours, on v1.40.2 behind a runtime guard, removes the copy described under Chunked HTTP/1 bodies from the upstream.

Comparison, guard on against guard off inside one rebuilt binary CPU per request [95% interval] Basis
1 MiB body in 8 KiB chunks, 800 req/s −1.40% [−2.31, −0.48] Measured
64 KiB body in 8 KiB chunks, 4,000 req/s −0.36% [−1.65, +0.94] Measured, not a finding
64 KiB body that nginx sends in two 32 KiB chunks, 2,000 req/s −0.02% [−1.26, +1.24] Measured, not a finding

On one 2016-era server over loopback (Envoy v1.40.2, 4 workers, HTTP/1.1 on both sides, 8 KiB chunks), Envoy copies every byte of a chunked HTTP/1 response body that a content-length body moves without a copy. At 1 MiB that copy is about 5% of worker CPU, about two thirds of the 8.8% chunked premium. A change local to the HTTP/1 codec that hands the body on as fragments of the read buffers removes the copy. It saves only 1.4% (95% interval 0.5 to 2.3) of Envoy’s CPU per 1 MiB response, and nothing measurable at 64 KiB (−0.4%, −1.7 to +0.9), guard on against guard off inside one build. The fragments cost about half of the copy again in user-space bookkeeping, and the body leaves in 43% more pieces over 37% more writes, which costs kernel time. The change also keeps read buffers alive longer (+6 MiB, +20%, allocated at this load; more with slow clients, not measured). That is under our 3% line, and we do not propose it.

Limits. One session on 24 November 2026: 6 rounds for each 8 KiB-chunk row and 8 for the nginx row, in a balanced order, with a same-build check that passed on every shape. 8 KiB chunks come one per origin write. On loopback about three quarters of the cycles are kernel time; how this nets out on a real network is not measured: the user-space share is larger there, and the extra writes and pieces cost there too. The patch is not part of any Envoy release and has not been reviewed by the Envoy project. The data for this section is in the harness repository at tag waves-2026-11d: the configuration in examples/wave8w1, the run notes in docs/wave-studies.md, the rendered table docs/wave-tables/chunked-copy/w1-table.md and the raw data in the release archive waves-2026-11d-data-chunked-copy.tar.gz (checksums in SHA256SUMS).

Measured but not published

These were measured, but the measurements do not hold up well enough to publish, so they carry no number here:

  • tail latency on the TLS rows, which measured the client’s reconnect waves rather than the proxy;
  • latency through two proxy hops (what the second hop costs on its own is now in What a second Envoy hop costs in CPU);
  • maximum sustained rates for the two-hop chains and for the connection reuse order;
  • latency for the external authorization rows, which includes the service’s response time;
  • CPU figures for the request-cap and idle-timeout settings after a stall, and latency figures for the connection reuse order beyond the direction given above;
  • the CPU of the external processing and authorization test services;
  • syscall counts per gRPC stream message: every run failed its check for late events (2.0% to 6.2% of events late against a limit of 0.1%);
  • prices for HTTP/2 from the origin on 64 KiB and 1 MiB bodies, held until a second HTTP/2 origin agrees;
  • comparisons of configurations on streamed responses, whose same-build checks failed (the level per event is in Bodies, buffers and streams).

What we withdrew or dropped

Several results we believed for a while turned out to be wrong, and one flaw sat in our own method. All were caught before publication. The connection-reuse flaw also affected the runs behind the PGO post, which says so. For each: the error, how we caught it, and the rule it left behind.

The connection reuse in our load generator. Nighthawk’s default HTTP/1 connection reuse (mru) keeps reusing the most recently used connections, so 2 to 4 of Envoy’s 4 workers carried the load, a different set in every run. Cycles per request followed the busiest worker’s share: the more one worker carried, the cheaper a request looked (correlation −0.80 to −0.87 on two request shapes). Spreading requests over every connection cut the standard deviation of paired differences from 6.9% to 1.3% on one shape and from 6.5% to 1.9% on the other. Large effects and instruction counts stood; smaller cycle results from those runs were set aside, and the route and header comparisons have since been re-measured with the load spread. Rule: spread the load (Nighthawk’s --experimental-h1-connection-reuse-strategy lru), and fail any run that one worker dominates.

The wrong binary. A later build repointed Bazel’s bazel-bin symlink, so three early verdicts rested on builds without optimization. Their apparent gains of 37% to 89% were void. Rule: copy every binary out, prove it is optimized and record its hash.

Stale symbols. Envoy’s build ID is its git commit, so perf served cached symbols from a different build of the same commit. Rule: clear the symbol cache between builds.

An energy saving. We reported a 17% to 25% energy saving from fewer workers, then withdrew it: the load generator’s idle loop was spinning on the same processor package. Rule: a sleeping client, and Envoy alone on its socket.

An A/A offset that was chance. Same-binary runs seemed to show a small bias, at a z of about 2.7. It came from leaving one run out and pooling t values as if they were z values. A run with the labels swapped settled it as chance. Rule: pool only like with like, and check any apparent bias with a label swap.

Our own regression. An earlier revision of the path-first change reordered regex routes too. On a benchmark we wrote to check it, with regex routes that each require a header the request does not send, that revision ran 2.1 to 4.1 times slower than main in every round. The current change leaves regex routes in their original order. Rule: benchmark the case a change can make worse, not only the one it improves.

Misrouting in the index. The prototype’s first way of taking a literal prefix from a regex misrouted on alternation and on quantified literals, and our own review found two more defects, in case-insensitive exact routes and in how regex bytes were encoded. The fix takes the prefix from RE2’s PossibleMatchRange() and adds differential tests against the linear scan. Rule: an index is tested against the scan it replaces.

Ideas we dropped. “Not resolved” means the CPU change was inside the noise of those runs, not that there was no effect.

Idea The change Verdict
TLS write batching halved writes per request CPU change not resolved
One-pass HTTP/1 header encode fewer passes over headers not resolved
Deferred flush no change in writes; Envoy already coalesces not resolved
Stream free lists reused request objects not resolved
Larger buffer slices larger slices for bodies not resolved
BOLT after PGO post-link layout not resolved in the PGO post’s short test; the code-layout post later found about 5% (pooled, exploratory)
io_uring socket interface different I/O path more CPU on both machines tried; few rounds, direction only
tcmalloc per-CPU caches 10% to 19% fewer instructions no measurable change in CPU

What this does not cover

  • One machine, a 2016 server CPU (the mitigations section adds a cloud VM on a current Intel Xeon). One load level per row except the releases, one release for the settings, 4 workers (16 in one access-log row, 28 in the store-stats row) and loopback only, except in the worker section.
  • Client-side CPU, and the CPU of the collector, the stats receiver and the authorization and external processing services.
  • With deep idle states this machine charges more per request when load is spread thin (see the worker section), so every line names the idle-state setting. No settings row was repeated with idle states capped.
  • From the client, TLS 1.2, other ciphers and certificate chains with an intermediate; towards the upstream, TLS 1.3 and handshakes.
  • Streaming gRPC, HTTP/3 beyond the companion post’s rows (0-RTT, GRO, client-closed connections, many-connection HTTP/3, a NIC path and clients other than Envoy’s QUIC client), arm64, connection-heavy traffic beyond the two TLS reconnect shapes, the plaintext reconnect shape of the exact_balance row and one HTTP/1.1 request per connection at low load, larger xDS configurations, delta xDS and xDS from a gRPC control plane.
  • Route-table size: what a 1,000-route table costs Envoy per request is priced separately.
  • For the sections added on 23 November:
    • streamed responses above low load, slow clients and small HTTP/2 stream windows;
    • chunked bodies from any origin but our own, which sends one chunk per write;
    • tracing with a sampler extension or an incoming trace context;
    • any stack of features other than the one we chose;
    • a chain with more or fewer than ten such filters, so the cost per filter is a mean of ten.

If one of these figures does not match what you see, compare the conditions first.

What was added when

This list prices eleven common settings and a second proxy hop. Two later sessions (features and filters) add compression, Lua and Wasm filters and the HTTP connection manager’s default idle timeouts. They also repeat five of the earlier settings (tracing, access logs, external authorization, retries and tcmalloc; eight table rows), and add a second traffic shape where it applies. Sessions on 21 and 22 November add external processing and the choice of gRPC client, the main-thread price of an xDS update and a summary of what connections and upstream protocols cost, whose full account is a companion post; a section of its own prices a patch of ours to the statsd sink, and later sessions price the kernel’s CPU-vulnerability mitigations on this server and on a current cloud CPU. Three sessions on 23 November add features that are on and take no action, chunked bodies, buffer limits and streamed responses and a candidate patch for tracing at 0% sampling; what a second hop costs as tcp_proxy has a post of its own. The list also compares thirteen official release binaries from seven release lines at two load levels, measures what surplus worker threads cost in a container pod, and prices one experimental change to how the upstream connection pool picks a connection. A session on 30 November adds what exact_balance costs under constant reconnects. Sessions of 19 and 20 November, published with the stats post, add three stats sinks and the store’s stat updates. Sessions on 27 and 30 November measured the deferred-span patch again on a different comparison; a note under its table has both readings.

Credit

Envoy, its filters and extensions are the work of the Envoy project’s contributors, and the load generator is Nighthawk. The measurements and any error in them are ours.

← All writing