Skip to content

P4: standby-depth / replenishment-concurrency sweep to locate the true cause of the c=8 knee #260

Closed

Description

@pdettori

Summary

E11 found knee=8, bound=replenishment on both arms at the tested configuration (StandbyDepth D=2, fixed guest RAM 256 MiB — see the e11-ladder-microvm-d2-ram256.json filename and the vmpool.Config defaults in remote-worker/internal/vmpool/config.go: DefaultStandbyDepth = 2). Before reaching for more worker processes (#259), this issue asks whether the knee is a property of that specific config default — one replenishment in flight per run pool, a shallow standby depth — rather than a structural ceiling.

Why this matters

  • Cheapest possible lever: same experiment infrastructure as the existing E11 driver, just vary SH_STANDBY_DEPTH (and possibly how many concurrent replenishments a single runPool is allowed to have in flight — see remote-worker/internal/vmpool/runpool.go's warming int // replenishments in flight field, which is currently a per-run-pool counter, not obviously multiplexed).
  • Host resource headroom (CPU 0.001, memory 0.41 GB at 128 VMs) suggests there's room to hold deeper standby pools or run more replenishments concurrently without hitting any hardware limit — the question is whether the code currently allows it.
  • Directly complements P4: worker-process parallelism — does N microvm-worker processes give N× throughput? #259 (worker parallelism) rather than competing with it: this tests whether you can push the knee out on one worker before deciding you need more workers.

What's already known / where to look

  • remote-worker/internal/vmpool/config.go: StandbyDepth int // D, DefaultStandbyDepth = 2. ReplenishDelay time.Duration // grace before refilling a popped slot, DefaultReplenishDelay = 200 * time.Millisecond.
  • remote-worker/internal/vmpool/runpool.go: each runPool (one per workspace_key/session) tracks warming int // replenishments in flight and has a settled chan struct{} that a cold acquire waits on "rather than starting a second warming" — i.e., the current code appears to cap replenishment concurrency at one in-flight rebuild per run pool, which may be exactly what's capping the pool's overall replenishment throughput once enough run pools are cycling standbys simultaneously. Worth confirming this reading against the actual acquire/replenish code path before designing the sweep.
  • E11 driver: deploy/microvm/e11-density.sh already supports sweeping D_VALUES and RAM_MB_VALUES (see start_microvm_stack "$d" "$ram_mb" "$max_c" and the nested loop in main()) — the metal run only exercised one (D, RAM) point, so the sweep machinery for D already exists and is unused.

Open questions for the spec

  1. Is the "one warming in flight per run pool" reading above correct, and if so, is it a per-run-pool limit (would need more concurrent runs to see it bind) or is there also a pool-wide replenishment concurrency cap?
  2. Does raising D just delay the knee (more standbys to burn through before going cold) without raising the sustained throughput ceiling, or does it actually change the steady-state rate? These are different claims and the sweep should distinguish them (e.g., run long enough at each D to reach steady state, not just to exhaust a bigger initial buffer).
  3. What's the right independent variable — D alone, or also whatever governs per-run-pool replenishment concurrency (if that's a separate, changeable parameter)?

Suggested scope for a first cut

Repeat the existing c-sweep (1, 2, 4, 8, 16) at D=2 (baseline, already have this), D=4, and D=8, holding everything else fixed, and see whether the knee moves and by how much, and whether steady-state throughput past the old knee improves or just the point of first degradation shifts.


Part of rossoctl/moca-experiments#3 (P4 epic: next experiments after the metal STOP).

Activity

  1. pdettori commented on Sep 17, 2026

    @pdettori
    MemberAuthor

    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. Directly motivated by E11 (deploy/microvm/EXPERIMENTS.md):
    throughput peaks at c=16 then declines while p95 grows tenfold by c=64, and the bound
    is replenishment on both the microVM and container arms — this issue is the sweep over
    standby depth (D) and replenishment concurrency needed to locate which of those two
    knobs the c=8 knee actually traces to.

    Assisted-By: Claude (Anthropic AI) [email protected]

  2. pdettori commented on Sep 21, 2026

    @pdettori
    MemberAuthor

    Answered: the knee does not move with D, and the bound is a rate, not capacity

    This issue's suggested first cut has now been run on bare metal as part of the #291 re-run —
    SH_E11_D_VALUES="2 4 8", microVM arm, c=1…64 (wider than the 1…16 suggested here), 21/21 rungs,
    exit 0, on srv-r16b14s16 with the Go Exec client and SH_E11_COLD_LATENCY_MS=94.

    D knee cold crossing tput peak peak tput plateau tput standbys @c=64 Σ PSS @c=64
    2 8 8 8 81.0 62.0 52 0.324 GB
    4 8 8 8 85.0 61.5 179 0.653 GB
    8 8 8 8 83.7 60.7 439 1.443 GB

    Quadrupling D moves nothing — knee, replenishment crossing and throughput peak all stay at
    c=8. And D was demonstrably in effect, which is what makes this a real negative rather than a
    silent no-op: resident standbys went 52 → 439 and Σ PSS 0.324 → 1.443 GB.

    Open question 2, answered explicitly

    Does raising D just delay the knee (more standbys to burn through before going cold) without
    raising the sustained throughput ceiling, or does it actually change the steady-state rate?

    Neither. It does not delay the knee and it does not raise the sustained ceiling. D helps only
    below the knee, which is the signature of a buffer against a rate limit:

    p95 vs D=2 c=1 c=4 c=8 c=16 c=64
    D=4 −18% −19% −7% −1% +0.4%
    D=8 −24% −21% −5% −0.1% +3%

    A deeper buffer smooths bursts while demand is under the refill rate (c=1 p95 improves 73.0 →
    55.8 ms). Past the knee it buys nothing, and at c=64 it is slightly worse while costing 4.5× the
    memory.

    Why: replenish.go caps supply structurally

    Refills are one-at-a-time by design — "One timer per slot rather than a burst, so a finished Exec
    does not create D VMs in the same instant"
    — and the next refill is only scheduled after the
    previous completes, each behind a 200 ms ReplenishDelay. So per-pool warm supply is roughly
    1/(200 + 23 ms) ≈ 4.5 VMs/s whatever D is. Buffering cannot fix a rate deficit. The flat
    ~61–62 Exec/s plateau at every D says the same thing.

    So standby-depth sizing is not the lever for this knee. ReplenishDelay and the
    one-timer-per-slot serialization are.

    Also worth recording: nothing else binds. coresBusy is 4.8–5.2 of 72 at c=64 in every ladder, Σ
    PSS is 1.4 GB of 754 GiB, and admission refused nothing (SH_MAX_COMMITTED_MB was raised to
    409600 first, because a refused refill converts into a cold acquire by design and would have
    corrupted the very metric this sweep reads).

    Two caveats on the numbers above

    • At D=8 the knee=8 verdict is marginal. The p95-doubling criterion scales with the c=1
      baseline, which D improves, so the limit tightens to 111.68 ms and c=8's 110.45 ms clears it by
      1.1%. The throughput peak is the robust indicator here and says 8 unambiguously at all
      three D.
    • The sampler slows as standbys multiply: hostCpuSamples at c=64 fell 272 → 223 → 155 as the
      PSS walk grew to ~500 processes. Every rung still cleared ≥16, so all figures are quotable, but
      size cadence accordingly at high D.

    Full write-up, with the audit fields per rung, in EXPERIMENTS.md §"Issue #291 — the re-run"
    (PR #300).

    Carried forward, not dropped

    Closing this as answered on its stated scope (open question 2 and the suggested first cut).
    Open questions 1 and 3 — whether replenishment concurrency is capped per run pool or pool-wide, and
    what the right independent variable is if D is not it — are not answered here, and they are no
    longer a c-sweep. One relevant code reading, for whoever picks it up: replenishOne calls
    p.mu.Unlock() before p.warm(...), so restores are not serialized by the pool mutex and
    already can overlap; yet 62 Exec/s against E10's 23.06 ms restore implies only ~1.4-way effective
    restore concurrency. Something in the restore path serializes and it is not pool.mu.

    Whether that serializer is per-process or host-wide is exactly what #259 tests, so that
    diagnostic now belongs with #259's outcome rather than as a standalone sweep — plan in
    docs/notes/e259-worker-parallelism-runbook.md (PR #301). If #259 comes back "host-wide", this
    thread's remaining half becomes the main event and should be reopened or re-filed then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions