HeadlinesBriefing favicon HeadlinesBriefing.com

Modal Scales to 1M Concurrent Sandboxes

Hacker News •
×

At Modal, we run millions of sandboxes daily, supporting up to 50 thousand concurrent sandboxes per customer. As agents demand massive scale, we rebuilt our sandbox platform from the ground up. The new system runs 1 million sandboxes concurrently, creating tens of thousands per second with no practical scaling limits. We demonstrated this by launching 1 million sandboxes in under a minute.

Most container platforms hit scaling walls. Kubernetes scheduling is O(n×p) and serialized, with etcd writes creating bottlenecks at high pod rates. Our original architecture similarly relied on strong consistency and Postgres, causing O(sandboxes) coordination overhead and RPC bottlenecks at scale.

To unlock infinite scale, we eliminated central coordination entirely. Horizontally scaled scheduling servers use in-memory cached state from workers publishing to Redis streams. Workers are their own source of truth; scheduling servers contact them directly via RPC to create sandboxes. No datastores sit in the critical path—metadata writes happen asynchronously.

The result: sandbox creation requires just two network hops and one cheap CPU operation, enabling millions of concurrent sandboxes and burst creation rates that accelerate agent workloads without friction.