# How many idle sandboxes fit on one Mac?

One Mac kept 448 Spaces running as idle headless gVisor containers, or 126 Spaces as microVMs (1 vCPU, 1 GiB each), with every exec check passing, on a Mac Studio (Apple M2 Max, 96 GB), measured 2026-10-25 on Cua Spaces 0.15.0.

- Page: https://cua.ai/benchmarks/sandboxes-per-mac
- Measured: 2026-10-25
- Raw data: https://cua.ai/benchmarks/sandboxes-per-mac.csv
- Helper script: https://cua.ai/benchmarks/sandboxes-per-mac/files/density.sh
- Helper script: https://cua.ai/benchmarks/sandboxes-per-mac/files/env.sh
- Helper script: https://cua.ai/benchmarks/sandboxes-per-mac/files/sample.py
- Helper script: https://cua.ai/benchmarks/sandboxes-per-mac/files/envsnap.py
- gVisor containers: build Cua Spaces 0.15.0 DMG (https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg, sha256 8725a09ba4132aa8a1667fa48c86416c91d5dec0d3c7dc93f88f5f3e29e0aba0): bundled cua 0.9.0, Helpers/cua-spacesd 0.8.0, cua-vz; n = 15
- microVMs: build Cua Spaces 0.15.0 DMG (https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg, sha256 8725a09ba4132aa8a1667fa48c86416c91d5dec0d3c7dc93f88f5f3e29e0aba0): bundled cua 0.9.0, Helpers/cua-spacesd 0.8.0, cua-vz; n = 8

## Results

Most idle Spaces running at a step where every check passed. Higher is better.

| Result | Value | n | Measured |
| --- | --- | --- | --- |
| gVisor containers | 448 Spaces (max) | 15 | 2026-10-25 |
| microVMs | 126 Spaces (max) | 8 | 2026-10-25 |

## Method (gVisor containers)

Driver on the host: density.sh with `rollout_bench` (Rust SDK, built from the tag) against this release's daemon. Idle gVisor Spaces (--kind container --runtime gvisor --headless, 1 vCPU / 1 GiB, kept running) are added in steps to 1, 8, 16, 32, 64, 96, 128, then +32 to 256, then +64 (at most 32 creates in flight). After each step: wait for the host to settle, sample host memory and CPU, then 10 serial exec round trips on every running Space (`rollout_bench probe`). Stop rule: running < target (2% slack), any probe error, exec p95 > 2x the one-Space p95 (and > +5 ms), or < 8 GB host memory free+inactive. Headline = the most Spaces at a step that passed every check. samples.csv: one row per step.

## Environment (gVisor containers)

- Machine: Mac Studio, Mac14,13 (Mac Studio)
- Chip: Apple M2 Max, 12 cores
- Memory: 96 GB
- OS: macOS 26.6.2 (25G83)
- Where: local
- Kind: gvisor
- Image: ghcr.io/trycua/linux:24.04-slim
- Shape: 1 vCPU, 1 GiB per Space, --headless
- Settings: CUA_POOL_AUTO=off; built-in Linux runtime VM at its default size on this Mac, 4 vCPU / 32 GiB (CUA_RUNTIME_LINUX_CPUS=12 / MEMORY_GIB=64 were in the daemon's environment but the already-running runtime VM kept its size, per the daemon log)
- Other vms: 1
- Network: n/a (local)
- Build: Cua Spaces 0.15.0 DMG (https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg, sha256 8725a09ba4132aa8a1667fa48c86416c91d5dec0d3c7dc93f88f5f3e29e0aba0): bundled cua 0.9.0, Helpers/cua-spacesd 0.8.0, cua-vz
- App: 0.15.0
- cua: 0.9.0
- cua_spacesd: 0.8.0

## Caveats (gVisor containers)

- Last step that passed: 448 Spaces (exec p50 4.5 ms, p95 5.9 ms, against 4.9 ms with one). At the next step (512), creates and exec checks failed, so the ramp stopped.
- All run inside the built-in Linux runtime VM at its default size here (4 vCPU, 32 GiB).
- Idle Spaces (only cua-spacesd); a workload in each Space lowers the count.

## Reproduce (gVisor containers)

```sh
# On an Apple silicon Mac (macOS 26), with Rust (rustup) and git:
curl -fLO https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg
hdiutil attach -nobrowse -mountpoint /tmp/cua-dmg cua-spaces-0.15.0-darwin-universal.dmg
mkdir -p ~/bench && ditto "/tmp/cua-dmg/Cua Spaces.app" ~/bench/"Cua Spaces.app" && hdiutil detach /tmp/cua-dmg
git clone --depth 1 --branch cua-spaces-v0.15.0 https://github.com/trycua/cua ~/bench/cua
(cd ~/bench/cua/libs/cua && cargo build --locked --release -p cua-sdk --example rollout_bench --example channel_bench)
export PATH="$HOME/bench/Cua Spaces.app/Contents/MacOS:$PATH" CUA_HOME=~/bench/home DO_NOT_TRACK=1 CUA_TELEMETRY=0
RB=~/bench/cua/libs/cua/target/release/examples/rollout_bench
mkdir -p ~/bench/harness && cd ~/bench/harness && for f in density.sh env.sh sample.py envsnap.py; do curl -fLO https://cua.ai/benchmarks/sandboxes-per-mac/files/$f; done
CUA_POOL_AUTO=off cua daemon start --foreground &
bash density.sh gvh 768 32 --kind container --runtime gvisor --headless
```

## Method (microVMs)

Driver on the host: density.sh with `rollout_bench` (Rust SDK, built from the tag) against this release's daemon. Idle microVM Spaces (--kind microvm --headless, 1 vCPU / 1 GiB, kept running) are added in steps to 1, 8, 16, 32, 64, 96, 128, then +32 to 256 (at most 16 creates in flight). After each step: wait for the host to settle, sample host memory and CPU, then 10 serial exec round trips on every running Space (`rollout_bench probe`). Same stop rule as the gVisor run. Headline = the most Spaces at a step that passed every check. samples.csv: one row per step.

## Environment (microVMs)

- Machine: Mac Studio, Mac14,13 (Mac Studio)
- Chip: Apple M2 Max, 12 cores
- Memory: 96 GB
- OS: macOS 26.6.2 (25G83)
- Where: local
- Kind: microvm
- Image: ghcr.io/trycua/linux:24.04-slim
- Shape: 1 vCPU, 1 GiB per Space, --headless
- Settings: CUA_POOL_AUTO=off; runtime vz (bundled cua-vz)
- Other vms: 1
- Network: n/a (local)
- Build: Cua Spaces 0.15.0 DMG (https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg, sha256 8725a09ba4132aa8a1667fa48c86416c91d5dec0d3c7dc93f88f5f3e29e0aba0): bundled cua 0.9.0, Helpers/cua-spacesd 0.8.0, cua-vz
- App: 0.15.0
- cua: 0.9.0
- cua_spacesd: 0.8.0

## Caveats (microVMs)

- 126 microVMs ran. At the next step the extra creates failed to start: macOS allows 128 VMs per host, and two other VMs were running (the built-in Linux runtime VM and one idle VM).
- Virtualization.framework VM processes grew from 24.0 GB to 71.4 GB at 126 microVMs (about 385 MB resident each, 1 GiB guests).
- Idle Spaces (only cua-spacesd).

## Reproduce (microVMs)

```sh
# On an Apple silicon Mac (macOS 26), with Rust (rustup) and git:
curl -fLO https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg
hdiutil attach -nobrowse -mountpoint /tmp/cua-dmg cua-spaces-0.15.0-darwin-universal.dmg
mkdir -p ~/bench && ditto "/tmp/cua-dmg/Cua Spaces.app" ~/bench/"Cua Spaces.app" && hdiutil detach /tmp/cua-dmg
git clone --depth 1 --branch cua-spaces-v0.15.0 https://github.com/trycua/cua ~/bench/cua
(cd ~/bench/cua/libs/cua && cargo build --locked --release -p cua-sdk --example rollout_bench --example channel_bench)
export PATH="$HOME/bench/Cua Spaces.app/Contents/MacOS:$PATH" CUA_HOME=~/bench/home DO_NOT_TRACK=1 CUA_TELEMETRY=0
RB=~/bench/cua/libs/cua/target/release/examples/rollout_bench
mkdir -p ~/bench/harness && cd ~/bench/harness && for f in density.sh env.sh sample.py envsnap.py; do curl -fLO https://cua.ai/benchmarks/sandboxes-per-mac/files/$f; done
CUA_POOL_AUTO=off cua daemon start --foreground &
bash density.sh mvh 256 16 --kind microvm --headless
```

## Questions

### What stopped each ramp?

For gVisor, creates and exec checks failed at the step after 448. For microVMs, macOS allows 128 VMs per host and two other VMs were running, so 126 was the most.

### Can I run this myself?

Yes. The commands under Reproduce use the published Cua Spaces 0.15.0 release and the public trycua/cua repository at the tag cua-spaces-v0.15.0. A `cua bench run` command that wraps them is coming; it isn't in a release yet.
