Benchmarks

2026-10-07 — Adaptive Runtime: scaling, autoscaling and stability

Host: development VM (8 vCPU EPYC 7642, Ubuntu 24.04, kernel 6.8), tcp_migrate_req=1. Topology separate from the frozen 2-CPU baseline: instance i on CPU i (one event loop each), upstream and PHP-FPM (4 workers) on CPU 3, oha on CPUs 4-7.

Regression gates (single instance, Adaptive Runtime off, vs. the frozen baseline)

Interleaved release A/B (5 × 30 s), baseline binary 79399e08… against the build of each stage:

Scenarioafter D1after D3/D4
respond+2.0 %−1.4 %
static-small+1.2 %+2.3 %
cache-hit+0.8 %+0.5 %
TLS + HTTP/2+3.5 %+0.1 %
PHP+4.8 %+4.3 %

All within ±5 %; p99 and CPU/request within limits.

D1 — N instances (reuseport) vs. one instance with the same CPUs

bench/instances.sh, 3 runs × 10 s, medians; eff = rps(N) / (rps(1) × N).

Scenario (conns)1 inst2 insteffvs 1×2 loops3 insteffvs 1×3 loops
respond (64)51.4k92.5k0.901.04×166.8k1.081.14×
respond (256)52.4k102.6k0.981.08×159.0k1.010.97×
static-small (64)43.5k75.9k0.870.92×127.3k0.971.02×
static-small (256)43.2k82.2k0.951.00×144.2k1.111.08×
static-1m (64)4.22k8.96k1.061.07×13.05k1.031.06×
cache-hit (64)46.6k87.9k0.940.95×152.3k1.091.05×
TLS+H2 (256)34.0k65.4k0.960.92×115.8k1.131.08×
proxy (256)25.4k47.3k0.931.08×65.6k0.861.06×
php (64)13.3k15.4k0.580.95×15.8k0.401.04×
  • Web-tier paths scale close to linearly, but no better than one instance given the same CPUs (0.92–1.14×): multi-instance buys elasticity, not efficiency.
  • RSS: 26–30 MiB per instance (3 instances 79 MiB vs. 33 MiB for one 3-loop instance).
  • Connection share with 64 connections can be uneven (e.g. 25/26/13); with 256 it is even.
  • PHP is bound by PHP-FPM on one CPU: efficiency 0.4–0.6 — exactly the case the classifier must not answer with more scb instances.
  • Zero non-2xx responses at every point.

D5 — autoscaling under load (web-tier mode, min 1, max 3)

Concurrency sweep, 20 s per point, scripts/controller-d5.sh:

Pathconnsreq/sp99 mserrorsinstancesRSS MiB
respond843.6k0.280126
respond3249.3k1.040254
respond6499.1k1.100381
respond256154.6k3.000384
respond1024167.0k11.2403102
static-small64127.3k0.950380
static-small1024121.0k15.180398

Bursts from idle to 1024 connections for 5 s (three in a row, 8 s apart): 37.2k → 81.5k → 143.2k req/s while the controller grew 1 → 2 → 3 instances; p99 46 → 19 → 14 ms; zero errors. The pool scaled back to one instance after each sweep.

Compared with a fixed single instance on one CPU (~44–52k req/s, D1), the autoscaled pool reached ~3× the throughput at the same p99 band once three instances were active — on three times the CPUs, as D1 predicts.