perf(config): HZ 100→1000 to cut container-start latency (ABX-496) - #14
perf(config): HZ 100→1000 to cut container-start latency (ABX-496)#14AprilNEA wants to merge 2 commits into
Conversation
Container start is a chain of jiffy-rounded scheduler waits across the containerd/shim/runc/dockerd IPC handshake; at HZ=100 each rounds up to 10 ms. Cross-engine bench (ABX-496) measured container churn ~5x slower than a matched Colima guest (HZ=1000), which dominates multi-step docker builds (each step is a container): simple cold 8.1s vs 0.6s, 12-stage 12.7s vs 1.5s. NO_HZ_IDLE keeps the tick off when idle, so the idle-CPU target is unaffected — the cost is purely more timer interrupts under active load, the right trade for a build/dev runtime chasing OrbStack parity.
Greptile SummaryThis PR raises the kernel timer frequency to reduce container-start latency. The main changes are:
Confidence Score: 5/5This looks safe to merge. The post-configuration check covers both native and Docker builds. No blocking issues found in the changed code.
What T-Rex did
Important Files Changed
Reviews (2): Last reviewed commit: "build: assert CONFIG_HZ_1000 survives ol..." | Re-trigger Greptile |
The HZ bump is a choice symbol; olddefconfig silently drops or rewrites unsatisfiable choices, so guard it the same way the script already guards the squashfs/netfilter symbols.
Local validation result — this is a minor win, not the ABX-496 fixBuilt this config locally, swapped the HZ=1000 kernel into a bench guest (confirmed
So HZ=1000 is a small, clean improvement (NO_HZ_IDLE keeps the idle-CPU target intact), worth taking on its own merits — but it does NOT close the 8–13× build gap vs Colima. The dominant differentiator turned out to be elsewhere: runtime binaries (runc/containerd-shim, 11–17 MB) are executed from the host-backed VirtioFS share and page in ~8× slower than guest-local (ABX-496, Factor 2). Retitling this away from "the fix" — recommend merging as an incremental latency improvement, decoupled from the ABX-496 resolution. |
|
Superseded by #16 — the HZ=1000 change ships there alongside voluntary preemption and PSI-default-off as one coherent container-start-latency release (ABX-498). |
Why
Cross-engine
docker buildbench (ABX-496) on a matched host found ArcBox ~8–13× slower than Colima on per-step-heavy builds, while throughput-bound shapes (large context, real network builds) were only 1.3–1.9×. Localization (all in-guest, proxy ruled out):unshare -mpnf~0.2 ms.docker start -a0.74 s (ArcBox) vs 0.15 s (Colima);docker run busybox truefloor 1.13 s vs 0.22 s. Eachdocker buildRUN/COPY step is a container, so this multiplies (12-stage: 12.7 s vs 1.5 s).Root cause: the ArcBox guest kernel is
CONFIG_HZ=100(10 ms tick); Colima's guest (Ubuntu 6.8) isCONFIG_HZ=1000(1 ms tick). Container start is a chain of jiffy-rounded scheduler waits across the containerd-poll / shim-handshake-completion / runc / dockerd↔containerd-gRPC-backoff IPC path; at HZ=100 each rounds up to 10 ms, so a start pays dozens of 10 ms quanta where Colima pays 1 ms.HZ=100was the initial-commit default and was never revisited (onlyPREEMPT_LAZYhas a defending comment).Change
CONFIG_HZ_100 → CONFIG_HZ_1000on both arm64 and x86_64 defconfigs.Why it's a clean win
NO_HZ_IDLE=yis set, so the tick is off when idle regardless of HZ — the idle-CPU target (root CLAUDE.md<0.05%) is unaffected. The only cost is more timer interrupts under active load, which is exactly when we want finer scheduling for container churn. For a build/dev runtime chasing OrbStack parity, this is the right trade.Validation
Config-only; needs a kernel build + boot-assets bundle bump to measure end-to-end. Expected: the 8–13× per-step rows move toward the 1.3–1.9× throughput-bound band. A secondary ~10 % came from
rcu_expedited=1in the same probe (not included here to keep the change minimal; can follow as a cmdline tweak if wanted). Re-run the ABX-496 bench harness after the bundle bump.Refs: ABX-496.