Repository navigation
Description
Summary
E11's density sweep (c = 1…64, knee at c=8, bound: replenishment) ran its entire ladder against exactly one microvm-worker process — confirmed directly from deploy/microvm/e11-density.sh (start_microvm_stack starts one worker per (D, GuestRAMBytes) slice and the whole ACTIVE_RUNS sweep runs against it before teardown). This issue asks whether running multiple independent worker processes on the same host multiplies the ~39-43 execs/sec ceiling, or whether some shared host-level resource (snapshot I/O, the pinned memfile, virtiofsd, cgroup hierarchy) caps the host, not the process.
Why this matters
- This is the item most directly tied to the "multiple users, multiple sessions... optimized for throughput" goal at a service level. One worker's ceiling only matters for capacity planning if it's also the service's ceiling.
- Host resource headroom is enormous at the tested range (
hostCpuFraction~0.001 flat, Σ PSS ≤ 0.41 GB at 128 resident microVMs — seeremote-worker/internal/vmpool/pin_linux.go's CoW-sharing comment), so there's no obvious resource reason a second worker couldn't run alongside the first. Whether it actually scales throughput is untested. - The P6 density work already hit an analogous trap in a different tier: doubling worker count there moved the ceiling by -6%, because the host was already saturated and the bottleneck wasn't per-worker. Worth checking whether the same trap applies here before assuming linear scaling.
What's already known / where to look
- Driver:
deploy/microvm/e11-density.sh, specificallystart_microvm_stack/stop_microvm_stack(one process per config slice, each with its ownSANDBOX_ID, binding its own relay port) and the outer loop inmain()that currently never starts two microVM stacks concurrently. - Config: each worker process holds one
vmpool.Config(remote-worker/internal/vmpool/config.go) — oneSnapshotDir, oneStandbyDepth, oneGuestRAMBytes, fixed at process start. Two workers pointed at the sameSnapshotDirwould each independentlyPinMemoryFileit — worth checking whether that's safe/redundant (twoMAP_SHARED+mlockmappings of the same file should just double-count the lock accounting, not the physical pages, but this hasn't been verified under concurrent worker processes). - Host-level shared resources to watch for contention: the golden snapshot's memfile (page-cache reads),
/srv/jailand/srv/workspaces(per-VM directories — see the "chroot base / run dir must share a device with the snapshot" fix round indeploy/microvm/EXPERIMENTS.md), the jailer/cgroup hierarchy (microvm.slice), and vsock connection setup if it goes through any shared kernel structure.
Open questions for the spec
- Should the two (or N) workers share one
SnapshotDir, or does each need its own copy to rule out I/O contention as a confound? (Sharing is more realistic for a production deployment; separate copies isolate the variable better.) - What's the right topology to test first — 2 workers at moderate concurrency each, or N workers each pinned to c=8 (the known-healthy single-worker operating point)?
- Does this need its own relay/Redis instance per worker, or can they share the existing single relay from
e11-density.sh?
Suggested scope for a first cut
Start two microvm-worker processes (same snapshot, same D/RAM config) on the same metal host, repeat the c-sweep against each independently and simultaneously, and compare combined throughput/latency against 2x the single-worker c=8 numbers (39.04/s → expect ~78/s if it scales cleanly).
Part of rossoctl/moca-experiments#3 (P4 epic: next experiments after the metal STOP).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
pdettori commentedon Sep 17, 2026
Epic: rossoctl/rossoctl#2546 (Stream 2 — microVM sandbox tier, via sub-epic rossoctl/serverless-harness#256)
Status update (2026-09-17)
Still open, no PR yet. Motivated by E11's finding that the c=8 knee is
replenishment-bound with CPU/memory nowhere near saturated (
hostCpuFractionflat at0.001 through c=64) — this issue asks whether more
microvm-workerprocesses turn thatslack into throughput. No change since filing.
Assisted-By: Claude (Anthropic AI) [email protected]
pdettori commentedon Sep 21, 2026
Plan written, and the baselines in this issue need correcting before it runs
Runbook:
docs/notes/e259-worker-parallelism-runbook.md(PR #301), in the same shape as the #294comparison runbook.
Three things changed since this issue was drafted, from the #291 re-run on
srv-r16b14s16:1. The baselines are stale. This issue says "39.04/s → expect ~78/s if it scales cleanly".
Those are pre-#291 numbers. With the repaired driver and the Go Exec client:
So the two-worker target at the healthy operating point is ~161/s, not ~78/s. c=8 is the
comparison that matters; at c≥16
coldAcquireRateis already 1.00 and a second worker theremeasures recovery from saturation rather than clean scaling.
2. Two of this issue's premises are now measured, and one is wrong. The headroom argument
holds and is stronger than stated — but not at the numbers quoted here:
hostCpuFraction"~0.001 flat" was an artifact of the pre-E11: the density knee may be a driver artifact — host resource signals are sampled post-load, and the driver spawns ~9 processes per Exec #291 post-load sampling. The trueunder-load figure at the plateau is 0.067 (4.81 of 72 cores). Still enormous headroom, ~15×,
but the 0.001 should not be cited.
at 128), and reaches 1.44 GB at 439 standbys. Memory is a non-issue, which is why the runbook
recommends starting with a shared
SnapshotDirrather than isolated copies.3.
SH_MAX_COMMITTED_MBis per worker process. Each worker holds its ownvmpool.Configandits own admission budget, so two workers at 409600 can commit 800 GiB against 754 GiB of RAM. A
budget above installed memory means the gate cannot refuse before the OOM killer arrives, and every
density number becomes a measurement of the OOM killer. The runbook flags this as a sizing step, not
a detail.
Prerequisite: PR #299
Without it the microVM ladder will abort partway.
pss_bytes_for_pidsrefused on a dying VMM — apid
kill -0reports alive whose address space is already gone — and inhost_signals_snapshot'sidle-standby-residency poll that refusal is fatal. It fires 4–5 times per microVM rung and
killed the first three-arm run at c=4; two of four short runs died on it.
A per-session ceiling this issue does not mention
runPool.execGateis a one-slot channel per run pool, held from a successful acquire until thatVM is destroyed, whenever the launcher reports
SerializesExecsPerRun()—truefor Firecracker,deliberately, because the workspace ext4 image is not a shared-disk filesystem and two guests
mounting it rw would corrupt it (spec §4.3).
So one session executes one Exec at a time, and cannot exceed ~1/47.75 ms ≈ 21 Exec/s. The
measured 17.56 at c=1 is that ceiling, not a mystery. It does not serialize across users
(different
workspace_keys → different run pools → different gates), so it is not the multi-userbottleneck this issue is about — but it is a hard capacity-planning fact worth having in the epic:
no per-user SLO above ~20 Exec/s is reachable without a shared-disk workspace filesystem.
Why this is the right next experiment, and what it decides
Restores are not serialized by the pool mutex —
replenishOnecallsp.mu.Unlock()beforep.warm(...)— so they already can overlap across run pools within one worker. Yet 62 Exec/sagainst E10's 23.06 ms restore implies only about 1.4-way effective restore concurrency.
Something in the restore path serializes and it is not
pool.mu.This experiment is the cheapest test of whether that serializer is per-process or host-wide, and the
answer decides what work is worth doing at all:
T2 >= 1.8 × T11.2 × T1 < T2 < 1.8 × T1T2 <= 1.2 × T1#260 is now closed on its stated scope: the D sweep was run (D=2/4/8) and the knee does not
move, because the bound is the serialized 200 ms replenishment rate, not pool capacity. Its
remaining diagnostic half — per-pool vs pool-wide replenishment concurrency — belongs with this
issue's outcome, and if #259 comes back "host-wide" it becomes the main event.
docs(e259): rossoctl#259 needs no driver change, and name the vm-N co…
docs(e259): the ~62 Exec/s ceiling is per-process — two workers give …
docs(e259): correct the recommendation — do not scale out; the cap wa…
docs(e259): correct the recommendation — do not scale out; the cap wa…
pdettori commentedon Sep 22, 2026
Answered — but the answer is the opposite of the recommendation, and #301 now carries the correction
Answer: N = 1. Do not scale out.
The measurements in this issue's results doc reproduce and stand. What they measured is not what they
were read as. The per-process component was a hard-coded constant —
session.DefaultConcurrency = 4,a fixed pool of 4 goroutines draining the Exec queue per worker, which
e11-density.shneveroverrode (#305). So the two arms here compared 8 slots against 4, and the 1.82x is what that
ratio yields once per-worker throughput drops the measured 8.8%. Scale-out "worked" by multiplying
the constant.
MaxConcurrent=4(default)MaxConcurrent=16Raising one environment variable on a single worker beat this entire two-worker result by 1.40x,
at +3.6% p95, with none of the separations two workers need.
And with the cap lifted, scale-out is worth nothing. Holding total slots constant and varying only
process count (same host, 2026-09-22):
0.02 Exec/s apart, against 2.9% measured session drift, for +2.9 points of host CPU. Host CPU never
leaves 65–73% across one or two processes and 64/128/256 slots, so the idle third of the host is not
reachable by adding workers — what serialises is host-wide, in the restore path.
What this issue contributed, and is credited with
This issue's own instruction was "N should be found by extending this experiment, not by assuming
linearity continues." That was right, it was followed, and it is what produced the answer.
Also kept and used downstream: the overlap proof and the "
coresBusymust NOT be summed"corollary. That is what made the later two-worker comparison auditable at all — per-worker figures
matching (49.1/49.1) are the evidence the processes genuinely overlapped, and summing would have
destroyed it. Likewise the foreign-load sampling discipline and the instrument defects.
Revised guidance: one worker per host with
WORKER_MAX_CONCURRENTraised. Add hosts to addcapacity; raise the per-host number by needing fewer restores per Exec (#274).
PR #301 now opens the results doc with this correction. Ready to close once it merges.
docs: publish the Exec/s campaign results and preserve #303's dead ends
docs(e11): record where the mis-quoted c=8 figure actually came from
docs(e259): runbook for the worker-parallelism experiment
pdettori commentedon Sep 23, 2026
Closing — answered, with the correction now on
main.Answer: N = 1. The per-process component this issue found was
session.DefaultConcurrency = 4(#305, closed), so the two arms compared 8 slots against 4 and the 1.82x is what that ratio yields once per-worker throughput drops the measured 8.8%. Raising that one value on a single worker gave 172.88 Exec/s, beating this entire two-worker result (123.57) by 1.40x. With the cap raised, a second worker is worth 1.00x: holding total slots at 64 and varying only process count, 2x32 = 580.58 against 1x64 = 580.60 — 0.02 Exec/s apart against 2.9% measured session drift, for +2.9 points of host CPU.docs/notes/e259-worker-parallelism-results.md(PR #301, merged) now opens with that correction. The measurements in it stand and reproduce; only the recommendation changed.This issue got the method right, and that is why the answer exists. Its own instruction — "N should be found by extending this experiment, not by assuming linearity continues" — was followed, and extending it in both directions is what produced N = 1. Two things from it are still load-bearing downstream:
coresBusymust NOT be summed" corollary. That is what made the later two-worker comparison auditable at all: per-worker figures matching (49.1/49.1, 52.5/52.2) are the evidence the processes genuinely overlapped, and summing a host-wide counter would have destroyed exactly that evidence.Revised guidance: one worker per host with
WORKER_MAX_CONCURRENTraised — fewer ports, relays, Redises, admission budgets and supervision paths, and none of the seven separations two workers need. Add hosts to add capacity. Raise the per-host number by needing fewer restores per Exec (#274), since what serialises is host-wide: CPU never leaves 65-73% across one or two processes and 64/128/256 slots.Campaign record:
docs/notes/2026-09-22-exec-throughput-campaign-results.md.feat(vmpoolctl): --defer-reap-workers, recorded in every rung (rossoc…
feat(vmpoolctl): --defer-reap-workers, recorded in every rung (rossoc…
feat(vmpoolctl): --defer-reap-workers, recorded in every rung (rossoc…
feat(vmpoolctl): --defer-reap-workers, recorded in every rung (rossoc…