Sandbox limits and quotas
Sandboxes are in private preview, by invitation: they are enabled on request for existing Serenity Edge customers and partners (see Access). Limits may change during the preview; changes will be announced in the release notes.
Per-account limits
In the preview every account has the same limits. They apply to the account as a whole, whichever of its keys makes the call and whichever E2B_DOMAIN it uses. The error message states the number when you reach one.
| Limit | In the preview | What it counts | Over the limit |
|---|---|---|---|
| Running sandboxes | 48 | Sandboxes in the running state. Paused sandboxes do not count. Checked on create, fork, resume, and connect to a paused sandbox | 429 edge_concurrency_limit with Retry-After |
| Creates per minute | 60 | Sandboxes created in any 60-second window. A fork of n copies counts as n. A create refused for the running limit does not count | 429 edge_create_rate_limit with Retry-After |
| Sandbox size | The template's: 2 vCPUs, 2 GiB of memory, about 26 GiB of disk | The vCPUs, memory and disk of each sandbox | 400 edge_shape_limit |
| Templates | The public template, and your account's own templates when they are enabled, on request (see Save a sandbox as a template for their limits) | The templates the account may create sandboxes from | 403 edge_template_not_allowed |
| Running time | 24 hours | How long one sandbox runs | The sandbox ends (see Lifetime) |
A connect to a sandbox that is already running is never refused for the running limit, so an account at its limit keeps access to the sandboxes it has.
An account with several keys can also have limits per key, so that one key cannot take the whole account's share. A key over its own limit gets 429 edge_key_concurrency_limit or 429 edge_key_create_rate_limit (see Errors).
A spending cap is not offered in the preview. The limits above bound how many sandboxes run at once, not what they cost over time: set a timeout on every sandbox.
Site capacity
The sandboxes of every account share the capacity of a site. When a site has no room for another sandbox, a create, a fork or a resume gets 503 sandbox_capacity_unavailable, even when your account is under its own limits.
- Nothing is lost: a refused resume leaves the sandbox paused, and you can retry it.
- Retry later with backoff (see Handling 429 and 503).
- Kill or pause the sandboxes you no longer need, so that room comes back sooner.
Sandbox size
A sandbox has the size of its template: its number of vCPUs, its memory and its disk. The preview has one public template and therefore one size: 2 vCPUs, 2 GiB of memory and about 26 GiB of disk, of which 20 GiB are free when the sandbox starts.
- vCPUs are reserved, and CPU time is shared under load. A sandbox is billed for its 2 vCPUs whether its processes use them or not, but they are not dedicated physical CPUs. As on burstable instances, sandboxes share CPU time when many of them are busy at once, so a sandbox can get less CPU than its vCPUs while it is still billed for them. Its memory is reserved for it alone.
- You cannot choose another size. A
cpuCountormemoryMBon create that differs from the template's gets400 edge_shape_limit. - The size is what you are billed for while the sandbox runs (see Pricing and usage).
- Read a sandbox's size from
cpuCount,memoryMBanddiskSizeMBinGET /sandboxes/{sandboxID}.
Request limits
| Limit | Value | Over the limit |
|---|---|---|
| Control API requests in flight, per key | 8, sent and not yet answered | 429 edge_key_request_concurrency_limit with Retry-After |
| Control API requests per minute, per key | 120, in any 60-second window | 429 edge_key_request_rate_limit with Retry-After |
| Request body on the control API | 1 MiB | 413 edge_request_too_large |
| Time to answer a control API call | 90 seconds | 503 edge_upstream_timeout |
| Metadata of a sandbox | 4,096 bytes, as compact JSON with sorted keys | 400 edge_metadata_too_large |
| Copies in one fork | 1 to 100 | 400 edge_invalid_request |
GET /v1/usage requests in flight, per key | 2 | 429 rate_limit_exceeded with Retry-After |
GET /v1/usage requests per minute, per key | 30 | 429 rate_limit_exceeded with Retry-After |
The two limits per key count every call to the control API at https://api.serenityedge.ai: creates, reads, lists, pauses, connects and kills alike. They are not the limits of the inference API: requests under /v1 and requests on the sandbox paths never count against each other's limits. Commands, files, a terminal and ports go to the sandbox domain, not to the control API, and do not count either.
- A key can occasionally get one of these 429 answers slightly before it reaches the numbers above.
- When the control API as a whole is busy, a call can get
429 edge_sandbox_api_busywhile your key is under its own limits. Wait forRetry-Afterand retry. - A loop that polls a sandbox's state or the list uses the same budget as your other control calls: space the polls out.
- Reading your usage records with
GET /v1/usagehas limits of its own, the last two rows: it never counts against the control API limits, nor they against it.
Lifetime
| Running | At most 24 hours. |
| Paused | At most 30 days. A sandbox that stays paused for 30 days expires and is deleted. |
A sandbox also ends at its own timeout, which you set (see Timeouts).
Data lifetime
| Data | What happens to it |
|---|---|
| Memory and disk of a running sandbox that you kill, or that reaches its timeout | Discarded when the sandbox ends. |
| Stored memory and disk of a paused sandbox that you kill, or that expires after 30 days | No longer available from the kill or the expiry, and deleted afterwards in a periodic clean-up. |
| Paused sandboxes of an account whose access was revoked | Kept for 7 days from the revocation, in case it is undone, and not billed during that time; deleted after that. A legal hold can keep them longer. |
A killed or expired sandbox cannot be recovered: the time before its data is deleted is not a recovery window.
For what Serenity Edge logs about a sandbox and for how long, see Network access and security.
No service level
The preview has no service level.
- If a platform failure ends a sandbox, the sandbox is lost, with its memory and disk. Billing for it ends at the failure. There is no credit.
- Paused sandboxes are not backed up during the preview. If the site's storage fails, a paused sandbox can be lost, and a lost one cannot be resumed.
- The preview has one site, in the European Union, so there is no second site to move sandboxes to.
- Keep anything you need outside the sandbox: copy results out before a long wait, and do not treat a sandbox as storage.
- During maintenance, running sandboxes are paused, not killed, and your client resumes them (see Maintenance).