Which Sandbox Recovers Within Your Deadline?
Run the same pause-and-return drill on E2B, Vercel, and Cloudflare. Compare state checks and time to the first verified result, then size for the longest idle gap your workload actually needs.
Measure readiness from the next request
On E2B, test the lifecycle you intend to ship. The auto-resume example explicitly configures timeout to pause, and the documented timeout default is kill. For an illustrative drill, save an uncommitted edit with a known checksum and advance a disposable worker to counter value seven. Let the sandbox reach its idle transition. Record the time from the next request until the worker returns eight and a read confirms the checksum. If the request succeeds while the counter resets, record file recovery and process recovery separately. Run a fresh-start control with the same fixture and model-free workload so project boot time stays visible. For a burst test, issue several returns together and record each result separately. Paused E2B sandboxes are outside the running concurrency count, so simultaneous wake-ups are the point at which to measure queueing and rejected starts.
Auto-resume on request - E2B DocsProbe local files and mounted data separately
A Cloudflare sandbox name can still resolve to the same Durable Object after the underlying instance stops. In a disposable workspace, put one checksum fixture on the instance disk and another in a mounted bucket. Record results for a stop without a snapshot and a stop with a saved snapshot. On the next instance, restore the workspace and remount the bucket as separate steps, then time the first operation that needs both files. Run the same local-file probe on Vercel with its default persistence and with persistence explicitly disabled. Vercel documents automatic filesystem restoration for persistent sandboxes and separate snapshot storage billing. Use a separate counter probe whenever the next job depends on a running process. A recovered file alone gives you evidence for a filesystem-dependent handoff. A recovered file plus a reset counter tells you to add a restart or replay step before declaring the workspace ready.
Sandbox lifetime · Cloudflare Sandboxes docsTry pausing before planning a migration
A long wait between instructions and a long period of active execution lead to different choices. E2B excludes paused sandboxes from running concurrency and compute charges. If an agent spends most of its time waiting for a reviewer, test a pause-and-resume workflow before paying to keep an instance running or paying to migrate it.
Use a representative task with an explicit checkpoint. Record the sandbox ID, pause when the checkpoint is written, and confirm the sandbox no longer consumes a running slot. Resume it and check that the next action uses the checkpoint once. Look for a compute charge during the pause and verify any other billing line separately. If an in-flight job must finish during the wait, keep an uninterrupted-run test in the comparison.
Do paused sandboxes count toward the concurrency limit? - E2B DocsCompare what comes back after a stop
Vercel persistent sandboxes save and restore the filesystem on stop and resume. Their automatic snapshots have a separate storage meter. That makes Vercel a candidate when a checkout, dependency cache and progress file are enough to restart the agent. Test process continuity separately if the application needs it.
In an illustrative trial, an agent processes 40 fixtures before a 30-minute review break. Give it a file marking fixture 40 and keep a separate counter only in its running process. Stop or pause at the break, reopen the environment and record both signals. If the file survives and the process disappears, try launching a new process and completing fixture 41 exactly once. That outcome passes a file-based handoff and fails a live-process requirement.
PersistenceSeparate a sandbox name from its disk
Cloudflare lets a Worker reach the same Durable Object by name, while stopping the container ends its processes and local files. Use it for a bursty workload if the runner can rebuild its workspace or restore the required state. Put shared or long-lived outputs in a mounted R2 bucket and verify that the next container mounts it again.
For a concrete failure test, stop the container after a scratch edit and start it again under the same name. Verify that a deliberately exported artifact can be read and that the next task uses it. If the Worker recognizes the session but the expected local edit is missing, inspect where the runner wrote the file and whether the checkpoint finished before the container stopped.
Sandbox lifetime · Cloudflare Sandboxes docs