When Is Sandbox Memory Worth Paying For?

Compare E2B and Vercel Sandbox with the same interrupted workload. Verify what comes back, then price memory resume against filesystem restore plus replay.

Distinguish a preserved process from a successful restart

Use a disposable workload with three observable checkpoints. Write record 40 to disk, advance an in-memory counter to 57, and keep a worker blocked on a local input. After resuming, send one input and record the disk checkpoint, the next counter value, and the elapsed time until the worker returns a valid result. A preserved worker returns 58 directly. A restarted worker must rebuild records after 40 before it can produce the same result. Run the fixture through both explicit pause and timeout-driven pause on E2B. For the timeout case, save the lifecycle event alongside the result and look for a filesystem-only pause when the worker restarts. Repeat with a representative warm cache so the test measures the work you actually lose when memory disappears.

Sandbox persistence - E2B Docs

Give the filesystem route a fair replay test

For Vercel Sandbox, write the checkpoint and an input cursor to the persistent filesystem before stopping. Make the resumed worker read that cursor and record the identifiers it emits. Stop once immediately after committing a checkpoint and again just before the next checkpoint. Both trials should produce a contiguous output sequence with each identifier appearing once. The second trial exposes the upper end of replay cost for that checkpoint interval. Vercel bills automatic snapshot storage separately from compute, so record the snapshot line item over the same observation period as the runs. Convert it to dollars per cycle before comparing it with an active compute quote. If replay is cheap under both interruption points, shortening the checkpoint interval may cost more in writes than it saves in recovery.

Persistence

Write the standby acceptance test

Blaxel’s pricing page lists zero compute cost on standby. Verify exactly when standby begins for your account and what snapshot, volume, and image storage cost under the applicable rate table. Include the wait before standby in the pilot so your billed runtime reflects how the job actually behaves between requests.

Use an illustrative job that writes a checkpoint file, holds a different value only in memory, and opens a connection to a test service you control. Leave it idle for 30 minutes, then send another request. Record whether the file and value survive, whether the connection needs to reopen, and how long it takes to complete the next unit of work. Use the same test for every serious alternative.

Pricing | Blaxel

Check whether E2B resumes the process

E2B documents pause and resume for both filesystem and memory state. Test it with a process that can return a value generated before pause and held only in memory. A successful resume returns the original value and preserves the checkpoint file. If the file returns but the process starts fresh, your workload has experienced a disk-only recovery.

E2B documents a filesystem-only fallback under certain memory auto-pause snapshot backlogs, with rollout varying by region. If the process disappears, check the sandbox.lifecycle.paused event for pause_mode set to filesystem. If a reboot is acceptable, make the job recover from the checkpoint and measure the delay. If a reboot breaks the job contract, use the failure to decide whether the workload can tolerate this pause policy.

Sandbox persistence - E2B Docs

Convert running time into a comparable bill

Modal’s pricing page lists non-preemptible Sandbox CPU at $0.00003942 per physical core-second and memory at $0.00000667 per GiB-second. For an illustrative allocation of one physical core and 4 GiB over 60 billed hours, multiply 216,000 seconds by the sum of the CPU rate and four times the memory rate. That gives about $14.28 for compute before other charges or credits.

Use the same arithmetic with each vendor’s applicable units and measured billed duration. Confirm the plan fee, minimum billable allocation, retention, storage, and network charges in the official rate table and reconcile the estimate against a pilot usage export. Compare cost per completed job under the same recovery requirement. Equal-looking CPU or memory labels alone cannot establish equal completion times.

Pricing: Pay per second for GPUs and CPUs | Modal

Sources