From 4 Seconds to 648ms: Cloudflare Rebuilt Its Containers for AI Agents
Four seconds is a lifetime. When an AI agent is waiting for a sandbox to start, your user is staring at a loading screen while infrastructure catches up. Cloudflare just cut that wait to 648 milliseconds, and the way they did it is worth understanding.
A container is an isolated software environment, a private lightweight workspace that spins up on demand to run a specific task. AI agents need a fresh one for each task they work on. Traditional container infrastructure was not built for that pattern.
The previous approach was built for stable deployments. You chose an image and compute resources at deploy time, set up rollout configurations, and the platform managed everything centrally. That model works well for a web service running the same way around the clock. It falls apart when an AI agent needs a new environment every few seconds, for tasks it doesn’t know about until they arrive. Waiting for a central scheduler to find capacity and coordinate placement added seconds to every cold start.
Cloudflare’s fix is called the durable_object scheduling policy. The name sounds technical, but the idea is straightforward. Your code now picks the container image and compute size at runtime, right when the task is known. What used to require a separate deployment for each environment type is now an if statement in your application code. The infrastructure follows the code’s lead instead of the other way around.
That shift in control is also what enabled the speed gains. When the container’s controller knows exactly what it needs and where it is running, the infrastructure can skip the central coordination step and start on the same machine. Median startup dropped from 4.049 seconds to 648 milliseconds. The 95th percentile fell from 5.8 seconds to 910 milliseconds.
Cloudflare ran a burst test to validate the architecture. One account started 100,000 containers across six locations in 5.387 seconds. Most businesses will never approach those numbers. What matters is that the headroom exists.
The other meaningful addition is filesystem snapshots. Setting up a coding environment takes time. Cloning a repository, installing dependencies, and configuring tooling can add a minute or more before the agent does anything useful. Agents currently redo that setup from scratch every session. With snapshots, the agent sets up once and restores the workspace in seconds the next time. Work continues where it left off.
Speed compounds. For teams building AI development tools, automated testing pipelines, or any product that gives users isolated environments to work in, cold start times were costing real user experience. At 648ms median startup, that friction disappears.
Container infrastructure is becoming the foundation layer for AI agents the same way databases became the foundation for web applications. Getting it fast and programmable is not theoretical. It is what separates products that feel immediate from ones that always seem to be catching up.
Want to explore how faster AI infrastructure could benefit your business? Let’s talk.

