Scaling to 1 million concurrent sandboxes in seconds
Modal rebuilt its sandbox control plane to run 1 million concurrent sandboxes, creating all of them in under a minute, by removing central coordination and durable stores from the creation path. A horizontally scaled fleet of scheduling servers picks workers using in-memory state that workers publish to a Redis stream, then calls the worker directly over RPC; workers act as their own source of truth and reject requests when full. Kubernetes and Modal's old Postgres-backed design hit limits from O(pods) and O(nodes) etcd and Postgres writes and serialized scheduling. The new path takes two network hops, scheduling takes tens of milliseconds, and median start time is under 0.5s, with tail latency driven by kernel rtnl lock contention during container networking setup.
Related posts
- How Abundant designed efficient rollout architecture with Modal Sandboxes
Modal easyNovice
Abundant runs its reinforcement learning rollout platform on Modal, with each of 75,000+ RL tasks executing in an isolated Modal Sandbox and Modal Functions powering the scheduler API. The design places a small monitor inside each Sandbox that sends heartbeats every 30 seconds, live events and final results over HTTP. The control plane retries three times before terminating a silent Sandbox. CPU and memory bursting let them request average rather than peak resources, cutting idle compute spend and avoiding OOMs. To counter evaluation awareness, they delete task instructions before work starts and add a reviewer agent that flags suspicious traces during verification.
- Unpacking sandbox startup latency: why started ≠ ready
Modal mediumAdept
Container scheduling and boot time, the figure most sandbox benchmarks measure as time to interactive, is usually the smallest part of startup latency. The gap between a sandbox being Started and being Ready (git clone, npm install, servers coming up) often runs to multiple seconds or more. Modal recommends warm sandbox pools backed by a modal.Queue to take that setup cost off the user's critical path, with Directory Snapshots to mount per-project state into generic pre-warmed sandboxes. The newly GA Readiness Probes, either a TCP port or an exec command checked via wait_until_ready(), replace fixed sleeps and custom health checks and add a ready event to the dashboard timeline.
- Sandbox resourcing: burst, don't reserve
Modal mediumAdept
Modal Sandboxes default to a tiny guaranteed request (0.125 cores, 128 MiB) and burst into a shared pool of idle machine capacity, billed per second on actual use rather than a fixed peak reservation. Since typical sandboxes spend over half their life under 6% of peak CPU, costs should be estimated from average rather than peak usage; an illustrative 20-minute coding-agent task comes out 58% cheaper than a fixed-size reservation. Bursting works because unrelated workloads rarely spike together, but CPU contention slows sandboxes and memory pressure can OOM-evict those above their request, backed by an SLO of under 0.0001% per minute for sandboxes under 8 GiB. Set limits for consistent eval/RL environments or cost caps, and raise the memory request if evictions are unacceptable.
- How Meta built the infrastructure for Threads
Meta Engineering mediumAdeptThreads reached 100 million sign-ups in five days on existing shared Meta infrastructure rather than purpose-built systems, illustrated through two components: ZippyDB and Async. ZippyDB, a multi-tenant key/value store, absorbs sudden demand by shifting unused allocations and slack between keyspaces via config changes. It scales out with a zero-downtime resharding protocol that remaps logical shards to new physical shards, which let the team proactively prepare Threads keyspaces for 100x growth just before launch. Async (XFaaS), a serverless deferred-execution platform, queued the far-higher-than-expected follow-graph imports and notification jobs and rate-limited their execution to protect downstream services such as the social graph database.
- NVIDIA Vera CPUs double throughput for Modal Sandboxes
Modal mediumAdept
Modal benchmarked NVIDIA's Arm-based Vera CPU for its multi-tenant Sandbox workloads and found up to 2x task throughput versus a comparable Intel Granite Rapids x86 host under heavy concurrent load. Individual task latency stayed equal or lower, whereas competing CPUs hit throughput plateaus as contention rose. On a quiet host, serial latency was only marginally better than Graviton 4/5, AMD Zen 5 and Intel GNR. The tests used an internal suite called Agentless Agent Bench: 50 Terminal-Bench oracle solutions run in concurrent prewarmed Docker containers without network calls. Modal attributes Vera's behaviour under contention to its high memory bandwidth, which allows denser packing and more forgiving burst capacity for spiky agent and RL rollout workloads.