Skip to main content

Envoy performance · part 12 of 12

Envoy --concurrency under a CPU limit: what 4 and 8 workers cost against Envoy's own 2

By Otto van der Schaaf, We-Amp ·

When Envoy runs in a container with a CPU limit, you leave the worker count to Envoy or set it with --concurrency. Setting more workers than the limit looks like headroom. On 2 December 2026, under a 2-CPU container limit (what Kubernetes sets for limits.cpu: 2), we priced that headroom in CPU: Envoy’s own choice against 4 and 8 workers, at four steady request rates. Latency was not measured.

8 workers used +8.80 log points [+8.08, +9.52] more CPU time per request than Envoy’s own choice of 2 at 2,080 req/s (about 9%), and +22.63 to +22.87 log points at 5,824 to 7,072 req/s (about 25%). 4 workers used +6.34 log points at 2,080 req/s and +10.10 to +10.27 above it. No other worker count we tried was resolved as using less CPU time per request than Envoy’s own choice of 2, at any of the four rates. No period ran out of quota on any arm at any rate, and every worker count carried every rate in 30 of 30 starts. The limit itself, at 2 workers: no difference resolved in CPU time per request at any rate; in cycles per request, +1.38 lp [+0.31, +2.45] at 7,072 req/s only, a finding; one session.

Conditions for every figure:

  • the official Envoy v1.40.2 binary, run on the libraries of the official container image;
  • HTTP/1.1, 4 KB responses proxied to an origin, over loopback, on one 2016 server;
  • a 2-CPU limit with the kernel’s 100 ms period, set by the container runtime, and 8 CPUs visible to the proxy;
  • four steady rates from 2,080 to 7,072 requests per second over 512 connections (16 client workers × 32 connections, open loop);
  • exact_balance on the listener of every arm (Envoy’s own default is no balancer), and the machine’s default idle-state settings;
  • restart-paired starts, pre-registered, one session.

A steady load like this one cannot show throttling below the limit; bursty traffic can, and we did not measure it. Log points (lp) are 100 × ln(with / without), close to a percentage for small values (+22.7 lp is about +25.5%). Brackets are widened 95% intervals. A finding passes the test corrected for the number of comparisons (Holm) and the price list’s small-effects rule: an effect under about 1% is never a finding, and one between 1% and 2% needs its widened interval to exclude zero. Otherwise we say no difference resolved. Series: Envoy performance, measured.

Contents

Which worker count does Envoy pick under a CPU limit?

With --concurrency unset, Envoy v1.40 and later on Linux start one worker per CPU the process may use: the smallest of the hardware threads, the CPU affinity and the container’s CPU limit. The limit is rounded down, with a minimum of 1. Under a 2-CPU limit that is 2 workers.

Envoy reads the limit from its own cgroup (cpu.max on cgroup v2), never from a parent. A 1.5-CPU limit (1500m) gives 1 worker; 2.5 CPUs give 2. With a 2-CPU limit and 8 CPUs visible, v1.40.2 without --concurrency started 2 workers; we checked that before the session from /server_info and the worker thread count. The reference arm runs at that count (--concurrency 2), and in this post it is “Envoy’s own choice of 2”.

A CPU request with no limit sets none of these bounds; the price list’s section on surplus worker threads covers that case. Here we priced 4 and 8 workers: counts that a template, or the hope that spare workers absorb a burst, might set.

Which Envoy versions size workers from the CPU limit?

Only v1.40.0 and later do it by default.

  • v1.40.0 and later: the rule above. --cpuset-threads now only logs a warning that it is the default. The v1.40.0 release notes record the fix (#45410, #45729).
  • v1.37.0 to v1.39.x: the v1.37.0 release notes describe the same default (#40997), but the code applied it only when --cpuset-threads was set. Without that flag the default was std::thread::hardware_concurrency(), usually the host’s hardware thread count, whatever the CPU limit.
  • Before v1.37.0: the default was the hardware thread count; --cpuset-threads sized it from the CPU affinity instead. No release read the CPU limit.

From v1.37.0, ENVOY_CGROUP_CPU_DETECTION=false turns the limit detection off. An Envoy before v1.40.0 in a 2-CPU container on a large node may therefore run far more workers than its limit without anyone setting --concurrency. We measured v1.40.2 only.

What did we measure?

Six arms (configurations), each at four rates, in 30 rounds, at 2,080, 5,824, 6,656 and 7,072 requests per second over 512 connections, open loop (requests sent on a fixed schedule, whatever the response time):

Arm Workers CPU limit
Envoy’s own choice 2 (--concurrency 2, Envoy’s own count) 2 CPUs
Same-configuration check 2 (--concurrency 2) 2 CPUs
4 workers 4 (--concurrency 4) 2 CPUs
8 workers 8 (--concurrency 8) 2 CPUs
2 workers, no limit 2 none
8 workers, no limit 8 none

Two measures:

  • CPU time per request leads. It is the container’s CPU time from the kernel’s accounting over the measured window, divided by the responses served: what the limit meters. Because it is the whole container’s time, it includes Envoy’s main thread and other non-worker threads.
  • Cycles per request sits beside it, as in the price list: the Envoy process’s cycles (user plus kernel, every thread) over the measurement window, divided by the responses in it.

We also counted, per start, the 100 ms periods that ran out of quota, and whether each arm carried its rate (served it within 1% of the target, with no client overflow).

What did 4 and 8 workers cost per request?

Envoy v1.40.2 under a 2-CPU limit: change in CPU time per request for 4 and 8 workers against Envoy's own choice of 2, at four request rates Dot chart with widened 95% intervals, in log points, against Envoy's own choice of 2 workers, all under the 2-CPU container limit, one session. 8 workers: +8.80 [+8.08, +9.52] at 2,080 requests per second, +22.63 [+21.80, +23.45] at 5,824, +22.87 [+22.07, +23.67] at 6,656 and +22.74 [+21.84, +23.63] at 7,072. 4 workers: +6.34 [+5.58, +7.11], +10.12 [+9.31, +10.92], +10.27 [+9.42, +11.13] and +10.10 [+9.17, +11.03]. All eight are findings. Points are not joined. The same figures are in the table below. 8 workers (--concurrency 8) 4 workers (--concurrency 4) 0 +5 +10 +15 +20 +25 Change in CPU time per request (lp) 2,080 5,824 6,656 7,072 Requests per second at 512 connections 8 workers against Envoy's own 2, 2,080 req/s: +8.80 lp [+8.08, +9.52], a finding+8.80 8 workers against Envoy's own 2, 5,824 req/s: +22.63 lp [+21.80, +23.45], a finding+22.63 8 workers against Envoy's own 2, 6,656 req/s: +22.87 lp [+22.07, +23.67], a finding+22.87 8 workers against Envoy's own 2, 7,072 req/s: +22.74 lp [+21.84, +23.63], a finding+22.74 4 workers against Envoy's own 2, 2,080 req/s: +6.34 lp [+5.58, +7.11], a finding+6.34 4 workers against Envoy's own 2, 5,824 req/s: +10.12 lp [+9.31, +10.92], a finding+10.12 4 workers against Envoy's own 2, 6,656 req/s: +10.27 lp [+9.42, +11.13], a finding+10.27 4 workers against Envoy's own 2, 7,072 req/s: +10.10 lp [+9.17, +11.03], a finding+10.10 Envoy v1.40.2 under a 2-CPU limit: change in CPU time per request for 4 and 8 workers against Envoy's own choice of 2, at four request rates Dot chart with widened 95% intervals, in log points, against Envoy's own choice of 2 workers, all under the 2-CPU container limit, one session. 8 workers: +8.80 [+8.08, +9.52] at 2,080 requests per second, +22.63 [+21.80, +23.45] at 5,824, +22.87 [+22.07, +23.67] at 6,656 and +22.74 [+21.84, +23.63] at 7,072. 4 workers: +6.34 [+5.58, +7.11], +10.12 [+9.31, +10.92], +10.27 [+9.42, +11.13] and +10.10 [+9.17, +11.03]. All eight are findings. Points are not joined. The same figures are in the table below. 8 workers (--concurrency 8) 4 workers (--concurrency 4) 0 +5 +10 +15 +20 +25 Change in CPU time per request (lp) 2,080 5,824 6,656 7,072 Requests per second at 512 connections 8 workers against Envoy's own 2, 2,080 req/s: +8.80 lp [+8.08, +9.52], a finding+8.80 8 workers against Envoy's own 2, 5,824 req/s: +22.63 lp [+21.80, +23.45], a finding+22.63 8 workers against Envoy's own 2, 6,656 req/s: +22.87 lp [+22.07, +23.67], a finding+22.87 8 workers against Envoy's own 2, 7,072 req/s: +22.74 lp [+21.84, +23.63], a finding+22.74 4 workers against Envoy's own 2, 2,080 req/s: +6.34 lp [+5.58, +7.11], a finding+6.34 4 workers against Envoy's own 2, 5,824 req/s: +10.12 lp [+9.31, +10.92], a finding+10.12 4 workers against Envoy's own 2, 6,656 req/s: +10.27 lp [+9.42, +11.13], a finding+10.27 4 workers against Envoy's own 2, 7,072 req/s: +10.10 lp [+9.17, +11.03], a finding+10.10
Each point is the change in CPU time per request against Envoy's own choice of 2 workers, both under the 2-CPU limit, at one steady rate in one session, in log points (+22.7 lp is about +25.5%). The bars are widened 95% intervals. All eight are findings. The points are not joined: no trend between rates is tested. Loopback, this CPU, exact_balance on every arm.

CPU time per request, against Envoy’s own choice of 2, all under the 2-CPU limit:

Workers 2,080 req/s 5,824 req/s 6,656 req/s 7,072 req/s
4 against 2 +6.34 lp [+5.58, +7.11] +10.12 lp [+9.31, +10.92] +10.27 lp [+9.42, +11.13] +10.10 lp [+9.17, +11.03]
8 against 2 +8.80 lp [+8.08, +9.52] +22.63 lp [+21.80, +23.45] +22.87 lp [+22.07, +23.67] +22.74 lp [+21.84, +23.63]

All eight rows are findings (Holm p < 0.0001, corrected for the number of comparisons), each 2% and over from one session. As percentages: 8 workers +9.2% at 2,080 req/s, and +25.4%, +25.7% and +25.5% at the three higher rates; 4 workers +6.5% at 2,080 req/s and about +10.6% to +10.8% above it.

Cycles per request, the same comparisons, beside:

Workers 2,080 req/s 5,824 req/s 6,656 req/s 7,072 req/s
4 against 2 +8.90 lp [+8.06, +9.74] +8.65 lp [+7.84, +9.46] +8.74 lp [+7.91, +9.58] +8.54 lp [+7.63, +9.44]
8 against 2 +12.10 lp [+11.30, +12.90] +20.69 lp [+19.88, +21.51] +20.54 lp [+19.76, +21.32] +20.31 lp [+19.45, +21.17]

These are findings too (Holm p < 0.0001), each from one session. The two measures agree in sign and in which rows are findings; their sizes differ, and we did not test why.

The extra cost of 8 workers changed between 2,080 and 6,656 req/s: +8.44 lp [+7.52, +9.35] in cycles per request, 8 against 2 workers, both under the 2-CPU limit (Holm p < 0.0001); one session. Its two ends are the rows above, +12.10 lp at 2,080 req/s and +20.54 lp at 6,656 req/s. The rows at 5,824 (+20.69) and 7,072 req/s (+20.31) are their own rows and show no further rise; we fit no line through the four rates. For 4 workers, the extra cost in cycles per request differed by less than 1 point between 2,080 and 6,656 req/s (−0.15 lp; 90% interval [−0.78, +0.47]); one session.

The same-configuration check, a second copy of Envoy’s own choice in the same rounds, passed at every rate. Its means read −0.21 to +0.24 lp in CPU time per request and −0.32 to +0.15 lp in cycles.

Does the cost of 8 workers come from the limit?

At these rates, we could resolve no difference.

At 8 workers, with the 2-CPU limit against without it, CPU time per request read −0.07 lp [−0.77, +0.62], +0.07 [−0.72, +0.85], +0.44 [−0.36, +1.24] and −0.42 [−1.18, +0.35] at the four rates: no difference resolved at any rate, each under about 1%. In cycles it read −0.03, +0.08, +0.42 and −0.37 lp, also none resolved.

With no limit on either, 8 workers against 2 used +9.10 lp [+8.38, +9.81] more CPU time per request at 2,080 req/s, and +22.54 [+21.69, +23.40], +22.67 [+21.82, +23.52] and +24.58 [+23.59, +25.57] at the three higher rates. In cycles: +12.54 [+11.78, +13.30], +20.53 [+19.68, +21.39], +20.39 [+19.57, +21.22] and +22.06 [+21.11, +23.01]. All are findings, one session. These rows hold for their own conditions only (8 against 2 workers, no limit on either, these rates, this traffic). The price list’s surplus-worker section measured a different setup, and the two are not comparable in size.

The extra CPU of 8 workers was there with no limit at all, and adding the limit to 8 workers changed nothing we could resolve. We did not test why surplus workers cost CPU here.

Did the extra workers run Envoy into the limit?

No. No period ran out of quota in any start of either arm (0 in 30 starts), for 4 and for 8 workers, at every rate. Every arm carried every rate in 30 of 30 starts, 8 workers at 7,072 req/s included.

As measured (mean and unwidened 95% t interval, beside the rows, not tested), 8 workers under the limit used 1.790 CPUs [1.785, 1.795] at 7,072 req/s, the highest of the limited arms (a share of 0.895 of the limit); Envoy’s own 2 used 1.426 [1.418, 1.435] there. A steady load like this one cannot show throttling below the limit; bursty traffic can, and we did not measure it. The zero counts hold for these steady rates only.

What did the limit itself cost at 2 workers?

At 2,080, 5,824 and 6,656 req/s, nothing we could resolve, in either measure. Envoy’s own 2 with the limit against 2 workers without it read +0.22 lp [−0.54, +0.98], −0.02 [−0.84, +0.81] and +0.24 [−0.58, +1.06] in CPU time per request, and +0.41, −0.07 and +0.28 lp in cycles, each under about 1%.

At 7,072 req/s with 2 workers, the 2-CPU limit made no difference we could resolve to CPU time per request (+1.42 lp [+0.27, +2.58], Holm p 0.055). In cycles per request the same comparison was +1.38 lp [+0.31, +2.45], a finding (Holm p 0.029); one session.

The cycles row is between 1% and 2%, and it is a finding only because its widened interval excludes zero. The CPU-time row misses the correction for the number of comparisons. The CPU-time family has 21 comparisons, fixed before the session. At that row’s place the multiplier is 9, so its raw p of 0.00612 becomes 0.0551. One of the 21 is the 1.5-CPU side run’s comparison, which did not run in this session; it keeps its place in the count. The separate 1.5-CPU run below sits outside these 21.

Envoy’s own 2 carried 30 of 30 starts with the limit at every rate, and none of its periods ran out of quota at any rate. So the +1.38 lp cannot be called throttling. It is a measured difference at the top rate, in cycles only, from one session, and we have no explanation for it.

What about a 1.5-CPU limit?

In a separate run under a 1.5-CPU container limit (one session), at 2,080 requests per second, 2 worker threads used 10.0% [9.2%, 10.9%] more CPU time per request than Envoy’s own choice of 1. Both counts ran under the same limit, and no period ran out of quota on either. The difference is the cost of the second worker thread at this rate.

This post’s plan included that comparison as a side run. We held the side run under the main session’s frozen plan and ran it on 3 December 2026 as a separate experiment, with two gate changes. One is a CPU-accounting check that the container’s accounting and perf count the same process. The other is a scheduler check, read at thread switches, that no other task used the proxy’s CPUs. At 1.5 CPUs, v1.40.2 without --concurrency started 1 worker; we checked that before the run.

2 workers against Envoy’s own choice of 1, both under the 1.5-CPU limit, at 2,080 req/s:

Measure Change As a percentage Reading
CPU time per request (leads) +9.56 lp [+8.80, +10.32] +10.0% [+9.2%, +10.9%] finding, Holm p < 0.0001
Cycles per request +15.52 lp [+14.59, +16.44] +16.8% [+15.7%, +17.9%] finding, Holm p < 0.0001

Each row is tested at the main run’s full count of comparisons, 21 for CPU time and 23 for cycles. The same-configuration check, a second copy of Envoy’s own choice of 1 in the same rounds, passed in both measures.

At 6,656 req/s, Envoy’s own choice of 1 worker carried the rate in 30 of 30 starts, and 2 workers in 30 of 30. The one-worker container used 1.00 CPU, which is all that one worker thread can use and 67% of the 1.5-CPU limit. No period ran out of quota on either count. This is a steady load on loopback.

The run’s conditions:

  • the official Envoy v1.40.2 binary on the libraries of the official container image;
  • HTTP/1.1, 4 KB responses proxied to an origin, over loopback, on one 2016 server;
  • a 1.5-CPU limit with the kernel’s 100 ms period, set by the container runtime, and 8 CPUs visible to the proxy;
  • two steady rates, 2,080 and 6,656 req/s, with the client recipe above; bursty traffic was not measured;
  • exact_balance on every arm (Envoy’s own default is no balancer) and the machine’s default idle-state settings;
  • restart-paired starts, 30 rounds, one session.

In each run, at 2,080 req/s, the worker counts above Envoy’s own choice used more CPU time per request. Envoy’s own choice is 2 workers under the 2-CPU limit and 1 worker under the 1.5-CPU limit.

What should you do on your own Envoy?

0. Check server.concurrency first. This admin stats gauge shows how many workers the process started. Compare it with the container’s CPU limit, especially on releases before v1.40.0: there the default ignored the limit (on v1.37 to v1.39, unless --cpuset-threads was set).

1. If something sets --concurrency above the limit, price it. In our session neither 4 nor 8 workers was resolved as using less CPU time per request than Envoy’s own 2. Measure your proxy at both counts: same configuration, fixed rate, several rounds in alternating order, plus a same-configuration run for your noise floor. The measurement loop and how to benchmark a proxy’s CPU describe how; the configuration CPU checklist lists other settings worth pricing.

2. Watch the throttle counter under your real traffic. The container’s cpu.stat counts the periods that ran out of quota (nr_throttled). Ours stayed at zero under steady load. If your traffic is bursty, read the counter on your own proxy before drawing anything from our zero.

3. With no limit at all, see the price list. A CPU request alone sets no bound that Envoy reads.

What should you not conclude?

  • That Envoy’s own choice can never be beaten. We tried 4 and 8 workers, at four steady rates, under one limit.
  • That 8 workers cost about a quarter more CPU in general. The figure holds for these conditions only: this server, v1.40.2, HTTP/1.1, 4 KB proxied over loopback, a 2-CPU limit, these four steady rates. A price holds for its load, as the cost-by-load post shows.
  • That 8 workers never throttle. No period ran out of quota at these steady rates; bursty traffic was not measured.
  • That the limit costs about 1.4% at 2 workers, or that it is free. The CPU-time row at 7,072 req/s is not resolved; the cycles row there is a finding, unexplained; the other rates read “no difference resolved”, with sizes.
  • That the extra cost of 8 workers grows with load. One row compares 2,080 with 6,656 req/s; the rows at 5,824 and 7,072 req/s show no further rise.

Not covered: latency; fewer workers than the limit (1 worker under 2 CPUs); worker counts other than 2, 4 and 8 under 2 CPUs, and other than 1 and 2 under 1.5 CPUs; rates outside 2,080 to 7,072 req/s under 2 CPUs; CPU per request under 1.5 CPUs at any rate but 2,080 req/s; limits other than 2 and 1.5 CPUs, or a limit set on a parent cgroup; more than 8 visible CPUs; other machines and idle-state settings; HTTP/2, HTTP/3, TLS and filter chains beyond the router; releases before v1.40.0; Envoy’s default listener without exact_balance.

How we measured

  • Conditions. The official Envoy v1.40.2 binary (1d64506e25c1844f146162ddb2ece7010fa4e784faddb40a079021491f1f03cc, from the release’s envoy-1.40.2-linux-x86_64) run on the libraries of the official container image (envoyproxy/envoy@sha256:8de97e654644827d62afdbf7e1d3dc9fee01a8690d410dd1c63a30dc6b6cecbb, tag v1.40.2); HTTP/1.1, 4 KB responses proxied to an origin; loopback; one 2016 x86-64 server; a 2-CPU container limit with the kernel’s 100 ms period, set by the container runtime; 8 CPUs visible to the proxy; the machine’s default idle-state settings; exact_balance on every arm’s listener (Envoy’s own default is no balancer; the worker-load post measures what that changes). A steady load like this one cannot show throttling below the limit; bursty traffic can, and we did not measure it.
  • The container. Docker on cgroup v2, one container per leg on the host network. --cpus 2 makes the runtime write cpu.max = 200000 100000; the no-limit arms have max 100000. Through Docker’s default private cgroup namespace, Envoy reads its own container’s cpu.max, as in a pod. --cpuset-cpus 0-7 gives the proxy 8 CPUs; we kept their SMT siblings idle and checked them. Client, origin and harness ran on other CPUs of the same machine. Kernel: Linux 6.8.0-151-generic. We left CPU frequency scaling at the server’s settings (not pinned).
  • Client. The epl-client-2026-11/v2 build of our Nighthawk fork (commit 63d819f6ab; binary sha256 60f4ac6fc10aba43268853ecf19f574d449c39843ba41303487af5f3b65245e5), with the price list’s recipe: 16 client workers with 32 connections each (512), open loop at a fixed rate, 5 s warm-up.
  • Restart-paired starts. Every leg (one arm at one rate in one round) ran in its own Envoy process and container, with a 20 s measured window. 30 rounds; each round ran all six arms at all four rates in a Williams-design order fixed before the session. 720 scored legs, all valid; every achieved rate was within 1% of its target.
  • What is counted. The measures are defined above. They count different things, the container’s accounted CPU time and the Envoy process’s cycles, so they can differ. Each comparison is made within a round, as 100 × ln(arm / reference).
  • Fixed in advance. Arms, rates, comparisons and mechanical readings were fixed before the session. We test the CPU-time comparisons (21) and the cycles comparisons (23) each as one group (a family), with the test corrected for their number (Holm). Each family includes one comparison of the 1.5-CPU side run, which did not run in this session and keeps its place. Each interval is the wider of the 95% interval and the 95% interval widened by the between-session spread.
  • Small effects follow the price list’s rule: under about 1% from one session is not a finding; 1% to 2% needs a second session or a widened interval that excludes zero.
  • What was visible during the session. While it ran, we could see each leg’s validity, the reason for any invalid leg, the invalid counts and the achieved rates. The harness sealed the comparisons and the carried-or-short counts and computed them once, after the session’s final checks passed. In an earlier attempt we found a defect in one of our own checks; we fixed it, re-froze the harness and ran a clean trial first. No figure from the earlier attempts is used here or anywhere else.

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 both runs are assets of the release t7-2026-12, with checksums; its README describes the archives. Corrections and your own results go to the harness’s issue tracker.

Credit

Envoy’s worker threading and its CPU-aware default worker count 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