Envoy performance · part 9 of 12
Envoy CPU per request under load: does a price hold at every request rate?
By Otto van der Schaaf, We-Amp ·
The price list gives most of its figures at one request rate: 5,200 req/s, where its reference proxy runs about 25% to 33% busy. Your proxy runs at other loads. So in one session on 30 November 2026 we measured, at three request rates, two effects the series has already priced, with the rates, comparisons and readings fixed in advance, to see whether a percentage measured at one rate holds at another.
For 20 constant response headers it did not. On the official Envoy v1.40.2 binary their cost changed with load: from +3.23% at 2,560 req/s to +4.41% at 7,808 req/s, CPU per request, one session (the change between the two rates is between 1% and 2%, with a widened interval that excludes zero). For the deferred OpenTelemetry span, a patch of ours, CPU per request changed by −1.53%, −2.05% and −2.40% at the three rates. The change between 2,560 and 7,808 req/s read −0.89% [−1.81, +0.04], which is under about 1% from one session and so not a finding by the price list’s rule. These are two changes; we make no general claim about patches, filters or settings.
Every figure is from one 2016 server over loopback, 4 workers, HTTP/1.1 and 4 KB proxied responses, with exact_balance on the listener as in the price list. The headers ran on the official v1.40.2 binary, the deferred span on our own build of v1.40.2 with that patch. Rates are requests per second at 512 connections. Loopback has no RSS, no NIC queues and no interrupt steering; on real hardware they change how busy each core is at a given rate. CPU per request is in percent and bracketed ranges are 95% intervals. The same session also measured uneven worker load; the other posts of the series are listed on Envoy performance, measured.
Contents
- Why ask whether a price holds at another load?
- What did we measure?
- What did the two changes cost per request at each rate?
- Did the CPU cost of 20 response headers change with load?
- Did the OpenTelemetry deferred-span saving change with load?
- How does this compare with the price list’s −2.88%?
- What should you do on your own Envoy?
- What should you not conclude?
- How we measured
- What this does not cover
- Where are the code and the data?
Why ask whether a price holds at another load?
A price on the list is a ratio: CPU per request with the change, divided by CPU per request without it, both at one fixed request rate. If you run Envoy at another rate, you need to know whether that ratio travels with you.
It matters most for small effects. A patch that saved, say, 2% at one load and 1% at another would change whether it is worth carrying.
We picked one cost and one saving the series has priced at 5,200 req/s: 20 constant response headers, from the priced checklist, and the deferred OpenTelemetry span, a patch of ours.
What did we measure?
Two runs, each comparing the same proxy with and without one change, at three request rates:
- 20 constant response headers on the official v1.40.2 binary: a route that adds 20 fixed response headers, against the same route without them.
- The deferred-span patch on our own build of v1.40.2: the OpenTelemetry tracer configured at 0% sampling, with the patch’s runtime guard on, against the same build with the guard off. The patch puts off building a span until a request is sampled. It is not part of any Envoy release and has not been reviewed by the Envoy project.
The rates were 2,560, 5,200 and 7,808 requests per second at 512 connections: 5, 10 and 15.25 requests per second on each connection. Each run had 18 rounds, and each round ran every configuration at every rate.
Each run has one row per rate and one row that asks whether the effect changed with load: per round, the effect at 7,808 req/s against the effect at 2,560 req/s. Only those two ends are tested; we make no claim about the shape of any change between the three rates.
What did the two changes cost per request at each rate?
exact_balance).| Change | 2,560 req/s | 5,200 req/s | 7,808 req/s |
|---|---|---|---|
| 20 constant response headers (official binary) | +3.23% [+2.37, +4.09] | +4.16% [+3.16, +5.17] | +4.41% [+3.59, +5.25] |
| Deferred-span patch, guard on against off (our build) | −1.53% [−2.33, −0.72] | −2.05% [−2.76, −1.34] | −2.40% [−3.17, −1.63] |
Case: every header row and the deferred-span rows at 5,200 and 7,808 req/s are “2% and over: one session”; the deferred-span row at 2,560 req/s is “between 1% and 2%, widened interval excludes zero”.
The Case column applies the price list’s rule for small effects, quoted under how we measured; “the page” in it means the price list. Every percentage interval is the wider of the 95% interval and the 95% interval widened by the between-session spread.
| Did the effect change with load? (7,808 against 2,560 req/s) | Figure [widened interval] | Case |
|---|---|---|
| 20 constant response headers: the cost at 7,808 req/s relative to the cost at 2,560 | +1.15% [+0.12, +2.19] | between 1% and 2%, widened interval excludes zero |
| Deferred-span patch: the change between 2,560 and 7,808 req/s | −0.89% [−1.81, +0.04] | under about 1% from one session: not a finding by the page’s rule |
The extra cycles per request behind those percentages, with 95% intervals:
| Change | 2,560 req/s | 5,200 req/s | 7,808 req/s |
|---|---|---|---|
| 20 constant response headers | +19,701 [+16,319, +23,083] | +21,852 [+17,821, +25,884] | +21,492 [+19,152, +23,832] |
| Deferred-span patch | −9,838 [−13,083, −6,592] | −11,462 [−13,167, −9,757] | −12,495 [−14,851, −10,140] |
And how busy Envoy was without and with each change: its CPU time over the measured window, all its threads, as a share of four cores, with 95% intervals:
| Run | 2,560 req/s | 5,200 req/s | 7,808 req/s |
|---|---|---|---|
| Headers: without → with | 0.186 [0.186, 0.187] → 0.191 [0.190, 0.191] | 0.312 [0.310, 0.313] → 0.323 [0.322, 0.325] | 0.427 [0.425, 0.428] → 0.445 [0.443, 0.447] |
| Deferred span: guard off → on | 0.194 [0.193, 0.195] → 0.192 [0.191, 0.192] | 0.329 [0.328, 0.330] → 0.323 [0.322, 0.324] | 0.454 [0.452, 0.456] → 0.443 [0.442, 0.444] |
Did the CPU cost of 20 response headers change with load?
Yes, in this session: the headers’ cost changed with load, from +3.23% at 2,560 to +4.41% at 7,808 req/s. Compared round by round, the cost at 7,808 req/s relative to the cost at 2,560 was +1.15% [+0.12, +2.19], between 1% and 2%, widened interval excludes zero. It compares, round by round, the with-and-without ratio at 7,808 req/s with the same ratio at 2,560. Subtracting the two percentages in the table, or dividing one by the other, gives a different number.
The extra cycles per request read +19,701, +21,852 and +21,492 at the three rates; the intervals overlap and no row tests a change. On this machine busier cores cost less per request, so the same extra cycles are a larger share of a smaller total. That is consistent with the headers’ row. We did not test it.
The checklist publishes +4.15% [+3.39, +4.91] for the same 20 headers, from a session on 29 November 2026. In a later session the same comparison measured +4.16% [+3.16, +5.17]. We do not pool the two.
Did the OpenTelemetry deferred-span saving change with load?
Not as a finding. The change between 2,560 and 7,808 req/s: −0.89% [−1.81, +0.04], under about 1% from one session: not a finding by the price list’s rule. Its three rate rows and extra cycles are in the tables above; the cycles’ intervals overlap, and no row tests a change in them.
That does not make the saving the same at every load: this session does not support a statement either way under the price list’s rule.
How does this compare with the price list’s −2.88%?
At 5,200 req/s this session measured −2.05% [−2.76, −1.34] for the deferred-span patch, with its guard on against off inside our build of v1.40.2. The price list publishes −2.88% [−3.70, −2.06] at the same rate for a different comparison: that build against the official binary, from one session on 23 November 2026. A session on 27 November 2026 measured −1.86% [−2.57, −1.15] on this post’s comparison. Both later intervals exclude −2.88%, and both overlap the published interval. The gap of about 1 point is open. The price list’s control row puts the difference between the two comparisons at −0.10% [−0.94, +0.74] in its session: none resolved, and up to about 0.9 points not excluded. We have not found the cause. We do not pool the three figures and we do not correct the published row.
The price list now carries the same three figures in a note under its deferred-span table.
What should you do on your own Envoy?
1. Read the rate next to every price. Most price-list rows are at 5,200 req/s, with the reference about 25% to 33% busy. A price is a price for its load: here Envoy used about 0.19 of four cores’ time at 2,560 req/s and about 0.43 to 0.45 at 7,808 req/s. At another load, treat the percentage as a starting point.
2. Price a change at the load you plan for. Your request rate does not map onto ours. How busy Envoy runs may be the closer comparison, but we did not test whether it transfers between machines. We measured nothing above 7,808 req/s or below 2,560 req/s.
3. Measure at two loads if a small effect decides something. The same proxy with and without the change at a light and a heavy fixed rate, several rounds in alternating order, plus a same-configuration run for your noise floor. Compare the effect at the two rates round by round. The measurement loop and how to benchmark a proxy’s CPU describe how we do that.
4. Send only the headers something reads. That is the checklist’s advice for its header rows, and in this session the 20 headers’ cost, as a percentage of CPU per request, was higher at 7,808 req/s than at 2,560 req/s.
If a small effect decides a change at your load, we can price it against your configuration at the request rates you run: see Envoy performance consulting.
What should you not conclude?
- That every patch, filter or setting changes its price with load. This session measured two changes.
- That the deferred-span saving is the same at every load. Its change between the two ends is not a finding by the price list’s rule, which is not the same as no change.
- That the headers’ cost moves in a straight line or in steps between the rates. Only 7,808 against 2,560 req/s is tested.
- That the published −2.88% for the deferred span is wrong, or that a later figure replaces it. The comparisons differ, the gap is open, and we have not found its cause.
How we measured
- Conditions. Envoy v1.40.2, 4 workers, HTTP/1.1, 4 KB proxied responses, on one 2016 two-socket x86-64 server over loopback, in one session on 30 November 2026. The headers run used the official release binary; the deferred-span run used our own build of v1.40.2 with that patch, the tracer at 0% sampling in both arms. Both runs used the price list’s base configuration, with
exact_balanceon the listener (Envoy’s own default is no balancer withreuse_porton; the worker-load post measured from the same session what the listener mode changes). - Client. The
epl-client-2026-11/v2build of our Nighthawk fork, with the price list’s 512-connection recipe: 16 client workers with 32 connections each, open-loop at a fixed rate. The fork’s changes are described in the measurement-loop post. - Restart-paired legs. Every leg ran in its own Envoy process: a 5 s warm-up, then a 25 s run with a 2 s lead-in and a 20 s measurement window. Each run has 18 rounds; each round ran every configuration at every rate in an order fixed by a seed before the session. A second, identical copy of the reference configuration ran in the same rounds as a same-configuration check, and every such check passed.
- What is counted. CPU per request is user plus kernel cycles of the Envoy process divided by the responses it served, compared within each round. The busy figure is Envoy’s CPU time over the measured window, all its threads, as a share of four cores.
- Fixed in advance. The rates, comparisons and readings were fixed before the session, and the readings are mechanical. The eight comparisons (three rates and one change-with-load row for each run) are tested together, with the significance test corrected for their number; the worker-load post’s 15 comparisons from the same session are a separate family, corrected on their own. Every percentage row is pre-registered and measured; the extra cycles and busy figures are reported beside them.
- The price list’s rule for small CPU effects: “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.”
What this does not cover
- Rates below 2,560 or above 7,808 req/s, and the shape of any change between the three.
- Other changes: we make no general claim about patches, filters or settings.
- Other sampling rates, a sampler extension, incoming trace context or child spans for the deferred span; the price list’s section lists the patch’s conditions.
- Headers that vary per request, or that are formatted from request data.
- Other load generators and client shapes. Every rate is Nighthawk, open loop, at 512 connections.
- HTTP/2, HTTP/3 and TLS, more than 4 workers, other machines and real traffic. On real hardware, RSS, NIC queues and interrupt steering change how busy each core is at a given rate.
- Latency. This session priced CPU per request.
- Costs paid once per flush interval, such as a stats sink’s flush. Spread over the requests of the interval, their share per request shrinks as the rate rises; the stats post measured them at one rate.
Where are the code and the data?
The harness is public at github.com/We-Amp/envoy-price-list (code under Apache 2.0, data under CC BY 4.0). The configurations and raw records for this session are assets of the release t15-2026-11, with checksums; its README describes the archives. The records of the 27 November 2026 session are assets of the release sb-otel-2026-11. The deferred-span patch and the state that was first measured are linked from the price list’s section. Corrections and your own results go to the harness’s issue tracker.
Credit
Envoy, its HTTP connection manager and its OpenTelemetry tracer are the work of the Envoy project’s contributors, and the load generator is Nighthawk. The deferred-span patch, the measurements and any error in them are ours.