Modal Sandbox bursting: pay for average use, not the peak
Modal Sandbox bursting bills each second at the higher of your request or real use, with a 0.125-core floor. Size your agent sandboxes by average load and set a memory limit.
Modal Sandbox bursting changes how you should size the machine your coding agent runs in. In a post on November 12, Modal explained that each Sandbox reserves a small minimum and bursts into spare capacity when it needs more. You pay each second for the higher of your request or your real use. An agent sandbox is idle most of the time, so the bill follows the average, not the peak.
What actually happened
Modal published Sandbox resourcing: burst, don't reserve. The mechanics:
- The billing rule. Each second, a Sandbox is billed for the higher of its request and what it uses.
- The floor. The default request is 0.125 cores and 128 MiB of memory. An idle Sandbox is billed at that floor.
- The ceiling. By default a Sandbox can burst up to 16 cores above its request. Memory has no default limit.
- The rates. Modal's list price in the post is 14.19 cents per CPU-hour and 2.40 cents per GiB-hour. One Modal CPU is a physical core, about 2 vCPU. The pricing page gives the same Sandbox rates per second.
- The controls. In the SDK,
modal.Sandbox.create(cpu=(0.125, 4.0), memory=(128, 2048))sets a request and a hard limit: 4 cores and 2 GiB in this example.
Modal's own example is a 20-minute coding agent task with a peak of 6 cores and an average of 0.44 cores and 0.94 GiB. Its calculator puts that at about 8.4 cents per Sandbox-hour, against 20 cents for a fixed 1.5-CPU, 3 GiB reservation. Modal labels these as illustrative workloads, not production traces, and the reservation rates are an assumption you can edit. The post also says a typical Sandbox spends more than half its life below 6% of its peak CPU.
Why Modal Sandbox bursting matters for your business
If you run agents that write and test code, the sandbox is a line on your bill. Most of that time the agent waits for a model call. A fixed reservation makes you pay for the pytest spike all day.
But burst capacity is shared capacity, and Modal states the cost plainly:
- CPU. If the machine runs out, a bursting Sandbox slows down until CPU frees up. Your request is always guaranteed.
- Memory. If the machine runs out, a Sandbox above its request can be evicted with an out-of-memory error. Modal's target for bursting Sandboxes under 8 GiB is about 1 eviction per 694 Sandbox-days. There is no target yet for larger ones.
- Your own limit. If a Sandbox crosses its memory limit, it stops.
What to do:
- Measure before you size. Record average and peak CPU and memory for one real agent task.
- Set a memory limit above the real peak. No default memory limit means a leak becomes a bill.
- Request more only where an OOM is expensive. Long jobs with no checkpoint need a higher memory request. Short retryable tasks do not.
- Make the request equal to the limit for evals. Benchmarks need the same machine each run.
- Handle the eviction. Detect the termination reason and retry from a snapshot.
Key takeaways
- Modal bills each Sandbox second at the higher of the request or real use
- Default floor: 0.125 cores and 128 MiB; default burst: up to 16 cores above the request
- List price in the post: 14.19 cents per CPU-hour, 2.40 cents per GiB-hour
- Memory has no default limit, and a Sandbox above its request can be evicted
- Size by measured average, cap memory, and retry on eviction
Agent infrastructure cost is a design decision, not a surprise. We build agent systems with measured sandbox sizing, hard limits and retry logic, on infrastructure you can move. See how we build agent systems, or estimate what your automation saves.
Sources: Modal: Sandbox resourcing: burst, don't reserve, Modal pricing.
- #modal
- #sandboxes
- #ai-agents
- #pricing
- #infrastructure
Tommy Rush — Founder, Rush Commerce
Operator turned builder. 15+ years running operations — now shipping the systems businesses run on. More
Get The Rush Report weekly — one email, zero fluff.
Keep reading
Salesforce SOV-Transcribe-1: open-weight speech-to-text, Apache 2.0
Salesforce SOV-Transcribe-1 is an open-weight speech-to-text model under Apache 2.0 with a claimed 2.28% WER. It's batch only. Test it on your own call recordings.
Read itllama.cpp v1.0.0: a stable API, and 35 functions removed
llama.cpp v1.0.0 brings semantic versioning to libllama and ggml, removes 35 deprecated functions and hardens llama-server. Pin the version and read the removals.
Read it