{
  "slug": "sandboxes-per-mac",
  "question": "How many idle sandboxes fit on one Mac?",
  "answer": "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.",
  "status": "measured",
  "url": "https://cua.ai/benchmarks/sandboxes-per-mac",
  "csv": "https://cua.ai/benchmarks/sandboxes-per-mac.csv",
  "markdown": "https://cua.ai/benchmarks/sandboxes-per-mac.md",
  "group": "Density and throughput",
  "series": [
    {
      "label": "gVisor containers",
      "run": {
        "run": "2026-10-25",
        "schema": "cua.bench-result/v1",
        "bench": "density.gvisor",
        "slug": "sandboxes-per-mac",
        "metric": "max_running_spaces",
        "value": 448,
        "unit": "Spaces",
        "stat": "max",
        "n": 15,
        "percentiles": {},
        "extra": {
          "exec_p95_ms_one": 4.9,
          "exec_p95_ms_at_max": 5.9,
          "vz_vm_rss_mb_before": 15136,
          "vz_vm_rss_mb_at_max": 22261,
          "highest_started": 495
        },
        "samples_csv": "samples.csv",
        "measured_at": "2026-10-25T01:51:05Z",
        "build": {
          "cua": "0.9.0",
          "cua_spacesd": "0.8.0",
          "app": "0.15.0",
          "source": "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",
          "published": true,
          "harness": "built from tag cua-spaces-v0.15.0 (709b18d9ee) on the host: cargo build --release -p cua-sdk --example rollout_bench --example channel_bench (Rust 1.97.1)"
        },
        "host": {
          "name": "Mac Studio",
          "model": "Mac14,13 (Mac Studio)",
          "chip": "Apple M2 Max",
          "cpus": 12,
          "memory_gb": 96,
          "os": "macOS 26.6.2 (25G83)",
          "where": "local"
        },
        "environment": {
          "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)",
          "load_avg_before": [
            4.4,
            4.88,
            5.04
          ],
          "other_vms": 1,
          "network": "n/a (local)"
        },
        "method": "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.",
        "reproduce": "# On an Apple silicon Mac (macOS 26), with Rust (rustup) and git:\ncurl -fLO https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg\nhdiutil attach -nobrowse -mountpoint /tmp/cua-dmg cua-spaces-0.15.0-darwin-universal.dmg\nmkdir -p ~/bench && ditto \"/tmp/cua-dmg/Cua Spaces.app\" ~/bench/\"Cua Spaces.app\" && hdiutil detach /tmp/cua-dmg\ngit clone --depth 1 --branch cua-spaces-v0.15.0 https://github.com/trycua/cua ~/bench/cua\n(cd ~/bench/cua/libs/cua && cargo build --locked --release -p cua-sdk --example rollout_bench --example channel_bench)\nexport PATH=\"$HOME/bench/Cua Spaces.app/Contents/MacOS:$PATH\" CUA_HOME=~/bench/home DO_NOT_TRACK=1 CUA_TELEMETRY=0\nRB=~/bench/cua/libs/cua/target/release/examples/rollout_bench\nmkdir -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\nCUA_POOL_AUTO=off cua daemon start --foreground &\nbash density.sh gvh 768 32 --kind container --runtime gvisor --headless",
        "caveats": [
          "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."
        ],
        "sources": [],
        "status": "measured"
      }
    },
    {
      "label": "microVMs",
      "run": {
        "run": "2026-10-25/result-microvm",
        "schema": "cua.bench-result/v1",
        "bench": "density.microvm",
        "slug": "sandboxes-per-mac",
        "metric": "max_running_spaces",
        "value": 126,
        "unit": "Spaces",
        "stat": "max",
        "n": 8,
        "percentiles": {},
        "extra": {
          "exec_p95_ms_one": 3.3,
          "exec_p95_ms_at_max": 1.6,
          "vz_vm_rss_mb_before": 24626,
          "vz_vm_rss_mb_at_max": 73112,
          "highest_started": 126
        },
        "samples_csv": "samples-microvm.csv",
        "measured_at": "2026-10-25T02:21:46Z",
        "build": {
          "cua": "0.9.0",
          "cua_spacesd": "0.8.0",
          "app": "0.15.0",
          "source": "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",
          "published": true,
          "harness": "built from tag cua-spaces-v0.15.0 (709b18d9ee) on the host: cargo build --release -p cua-sdk --example rollout_bench --example channel_bench (Rust 1.97.1)"
        },
        "host": {
          "name": "Mac Studio",
          "model": "Mac14,13 (Mac Studio)",
          "chip": "Apple M2 Max",
          "cpus": 12,
          "memory_gb": 96,
          "os": "macOS 26.6.2 (25G83)",
          "where": "local"
        },
        "environment": {
          "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)",
          "load_avg_before": [
            1.4,
            1.65,
            2.77
          ],
          "other_vms": 1,
          "network": "n/a (local)"
        },
        "method": "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.",
        "reproduce": "# On an Apple silicon Mac (macOS 26), with Rust (rustup) and git:\ncurl -fLO https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg\nhdiutil attach -nobrowse -mountpoint /tmp/cua-dmg cua-spaces-0.15.0-darwin-universal.dmg\nmkdir -p ~/bench && ditto \"/tmp/cua-dmg/Cua Spaces.app\" ~/bench/\"Cua Spaces.app\" && hdiutil detach /tmp/cua-dmg\ngit clone --depth 1 --branch cua-spaces-v0.15.0 https://github.com/trycua/cua ~/bench/cua\n(cd ~/bench/cua/libs/cua && cargo build --locked --release -p cua-sdk --example rollout_bench --example channel_bench)\nexport PATH=\"$HOME/bench/Cua Spaces.app/Contents/MacOS:$PATH\" CUA_HOME=~/bench/home DO_NOT_TRACK=1 CUA_TELEMETRY=0\nRB=~/bench/cua/libs/cua/target/release/examples/rollout_bench\nmkdir -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\nCUA_POOL_AUTO=off cua daemon start --foreground &\nbash density.sh mvh 256 16 --kind microvm --headless",
        "caveats": [
          "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)."
        ],
        "sources": [],
        "status": "measured"
      }
    }
  ]
}
