A request for a sandbox passes through four admission gates. This page shows each gate, each computation, and the pool that serves the Execs. Step through the sequence with the controls.
‹ moca docs · written page: Limits
The text below follows the rules of ASD-STE100. Each sentence holds one fact. Each sentence uses one action.
| Gate | Check | Knob | Default | Refusal |
|---|---|---|---|---|
| control plane | subject is enrolled | SH_ALLOWED_SUBJECTS | required | not enrolled |
| control plane | live sandboxes per subject | SH_SANDBOX_MAX_PER_SUBJECT | 3 | 429 quota_exceeded |
| control plane | live sandboxes, total | SH_SANDBOX_MAX_TOTAL | 40 | 429 quota_exceeded |
| relay | in-flight Execs per sandbox | SH_SANDBOX_MAX_INFLIGHT | 2 | RESOURCE_EXHAUSTED "sandbox busy" |
| worker | waiting Execs | QueueCap | 64, fixed | "busy: queue full" |
| worker | Exec concurrency slots | WORKER_MAX_CONCURRENT | 16 | queueing, back-pressure |
| worker | one Exec per workspace | execGate | fixed | wait at the gate |
| pool | memory budget | SH_MAX_COMMITTED_MB / SH_MEMORY_RESERVE_MB | required / 0 | "memory-budget:" → 503 |
| pool | standby charge | SH_STANDBY_HEADROOM | 4.0 ("full" = full RAM) | — |
| pool | unparked runs | SH_MAX_RUNS | 64 | "max-runs:" → 503 |
| pool | host free memory floor | SH_HOST_MEM_FLOOR_MB | 0, off | "host-memory:" → refused, not retryable (no 503) |
| Knob | Default | What it tunes |
|---|---|---|
| SH_STANDBY_DEPTH | 2 | standby VMs kept warm per run |
| SH_GUEST_RAM_MB | 256 | guest RAM per VM; the dominant cost term |
| VMOverheadBytes | 32 MiB | per-VM cost outside guest RAM |
| StandbyIdle | 90 s | idle time that parks a run (worker flag, not env) |
| SH_WORKSPACE_IDLE | 30 min (sandbox service: set longer than the sandbox lifetime) | idle time that deletes a workspace |
| ReplenishDelay | 200 ms | grace before a popped slot is refilled |
| replenish backoff | 250 ms → 30 s | retry curve for a failed refill |
| MaxReclaimsPerScan | 8 | VMs destroyed per sweep; reclaim rate limit |
| SH_WORKSPACE_IMAGE_MB | 2048 | disk per sandbox workspace |
| SH_SANDBOX_LIFETIME_SECONDS | 7 days | sandbox lifetime; expiry is computed, not scheduled |
| SH_SANDBOX_TOKEN_TTL_SECONDS | 900 | sandbox token lifetime |
| SBX_JANITOR_AGE / cadence | ≥ token TTL + 5 min / 15 min | grace and run rate of the host janitor |