---
title: "Scaling to 1 million concurrent sandboxes in seconds"
description: "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."
url: "https://swe.quest/articles/scaling-to-1-million-concurrent-sandboxes-in-seconds-44dad4f83cd974c1"
canonical: "https://modal.com/blog/scaling-to-1-million-concurrent-sandboxes-in-seconds"
source: "Modal"
published: "2026-07-16"
difficulty: "medium"
kind: "Case study"
reading_minutes: 10
tags: ["scheduling","scalability","sandboxing","distributed-systems","containers"]
---

# Scaling to 1 million concurrent sandboxes in seconds

A post on [Modal](https://swe.quest/sources/modal.md), published 2026-07-16, 10 min read, Case study. Original: [https://modal.com/blog/scaling-to-1-million-concurrent-sandboxes-in-seconds](https://modal.com/blog/scaling-to-1-million-concurrent-sandboxes-in-seconds)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Scheduling](https://swe.quest/tags/scheduling.md) (Distributed systems)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)
- [Sandboxing & isolation](https://swe.quest/tags/sandboxing.md) (Security)
- [Distributed systems](https://swe.quest/tags/distributed-systems.md) (Distributed systems)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)

## Prerequisites

- container scheduling basics ([easy posts on Scheduling](https://swe.quest/tags/scheduling.md?difficulty=easy))
- Kubernetes architecture ([easy posts on Kubernetes](https://swe.quest/tags/kubernetes.md?difficulty=easy))
- strong vs eventual consistency ([easy posts on Consistency models](https://swe.quest/tags/consistency.md?difficulty=easy))

## Keywords

Modal, Kubernetes, etcd, Redis Streams, Postgres, rtnl lock

## Related posts

- [How Abundant designed efficient rollout architecture with Modal Sandboxes](https://swe.quest/articles/how-abundant-designed-efficient-rollout-architecture-with-modal-sandboxes-6590e651fd7feefd.md): Modal · 2026-11-19 · Easy · 4 min read · Sandboxing & isolation, Model training, Evaluation, Serverless, Cost optimization
  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.
- [Unpacking sandbox startup latency: why started ≠ ready](https://swe.quest/articles/unpacking-sandbox-startup-latency-why-started-ready-4140487180749d22.md): Modal · 2026-06-22 · Medium · 7 min read · Sandboxing & isolation, Performance engineering, Serverless, AI agents
  Container scheduling and boot time, the figure most sandbox benchmarks measure as time to interactive, is usually the smallest part of startup latency.
- [Sandbox resourcing: burst, don't reserve](https://swe.quest/articles/sandbox-resourcing-burst-don-t-reserve-6ee1eed03f706498.md): Modal · 2026-11-12 · Medium · 6 min read · Sandboxing & isolation, Cost optimization, Capacity planning, Scheduling, AI agents
  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.
- [How Meta built the infrastructure for Threads](https://swe.quest/articles/how-meta-built-the-infrastructure-for-threads-961a6b509998fe97.md): Meta Engineering · 2023-12-19 · Medium · 7 min read · Scaling, Distributed databases, Multi-tenancy, Serverless, Resilience
  Threads 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.
- [NVIDIA Vera CPUs double throughput for Modal Sandboxes](https://swe.quest/articles/nvidia-vera-cpus-double-throughput-for-modal-sandboxes-40db65dda7f68f56.md): Modal · 2026-10-19 · Medium · 6 min read · Hardware, Performance engineering, Multi-tenancy, Sandboxing & isolation, AI agents
  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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
