Self-hosted sandboxes · measured on our own nodes

How do other self-hosted sandboxes compare?

The rest of the site measures runtimes that sit under a Kubernetes pod. Agent sandbox products start differently: some restore a snapshot instead of booting, some keep memory across a pause, some hand out a pod that is already running. This page measures every one of them we could run on our own infrastructure, on the same node type and at the same size as the pods, and labels each with what it runs on underneath.

Only things we can deploy ourselves. Hosted-only services (sandboxes that run on the vendor's machines) are left out. AWS Lambda MicroVMs run on AWS hardware but inside our own AWS project, so they are in. Edera was skipped.

Nodes: m8id.xlarge (4 vCPU, 16 GiB, local NVMe), kernel 7.0, nested KVM, us-east-2 · Sandboxes: 1 CPU / 2 GiB · 20 rounds each, one sandbox at a time · iteration 8

Verdict

What to know before you pick one

about 70 msA warm pool beats every bootHanding over a pod that is already running took 64 to 72 ms for every runtime, Kata included. 47 ms of that is kubectl apply. The isolation you pick stops mattering for start time, as long as the pool has a pod ready: this was measured one claim at a time with a full 2-pod pool. A burst bigger than the pool falls back to a cold start (2.6 to 3.6 s for Kata), which was not tested.
0.1 to 0.2 sSnapshot restore beats a cold bootE2B Embed (122 ms) and CubeSandbox (165 ms) create a VM sandbox faster than runc starts a pod (0.74 s; SDK create against Kubernetes Ready, so different end points), because they restore a booted VM instead of starting one.
steadyCubeSandbox has the steadiest pause and resumePause 45 ms, resume 262 ms, each within a few ms across 20 rounds. E2B's pause is 263 ms and its resume swings from 91 ms to 2.2 s.
no execkrun pods start like runccrun with libkrun gives a VM pod that is Ready in 0.72 s, the same as runc and well ahead of Kata's 1.7 to 3.7 s. But kubectl exec is not supported.
0.6 s, no pausemicrosandbox is quick to use, slower to createCreate takes 608 ms; after that a command takes 17 ms and a synced 1 MiB write 18.5 ms. It has no pause or resume.
1.4 s, size fixedLambda MicroVMs suspend and resume, but you can't size themCreate 1.45 s, suspend 0.46 s, resume 0.73 s, timed from a laptop. There is no CPU or memory option: the VM came up with 4 CPUs and 7.8 GiB.

Underneath

What each one runs on

"Runs on" names the stack under the product. Kernel and disk are what the probe saw from inside the sandbox; the pod runtimes are on this page so the new rows have something to stand next to.

SandboxRuns onKernel seen insideRoot diskA new sandbox isPause keeps
runc, Sysbox (pods)host kernel, namespaceshost 7.0host overlaya processno pause
gVisor (pods)user-space kernel4.19.0-gvisorthrough its file proxya processno pause
Kata QEMU, Cloud Hypervisor, Firecracker (pods)KVM VM per podguest 6.18.56virtio-fs share (block disk for Firecracker)a VM booted coldno pause
krun (pods)libkrun, through crunguest 6.12.115virtio-fs sharea VM booted coldno pause
Agent Sandbox warm poolpre-started pods of any runtime abovesame as the runtimesame as the runtimea running pod handed overno pause
E2B Embed (self-hosted)Firecracker, snapshot restoreguest 6.1.177ext4 on virtio-blka booted VM restored from a snapshotmemory and disk
CubeSandbox (self-hosted)its own KVM hypervisor, snapshot cloneguest 6.6overlay (virtio-pmem lower, virtio-blk upper)a reflink clone of a snapshot, restoredmemory and disk
microsandboxlibkrunguest 6.12.117overlay on virtio-blk and virtio-fsa VM booted coldno pause
AWS Lambda MicroVMsFirecracker, run by AWS in our projectguest 6.1.166image built from a Dockerfilea VM started from an imagememory and disk

Data: bench/results/probe/round2-node-a · lanes/*/README.md (probe .tsv files in each folder)

Start path · 1 CPU / 2 GiB · 20 rounds

Start, pause and resume, side by side

Median milliseconds; the main ranges are listed under the table. "Ready" is created until it can take work. Pod rows run their command and write through kubectl exec, which adds about 60 ms of kubectl start-up to each, so compare those two columns only within the pod rows. E2B, CubeSandbox and microsandbox are driven by their own SDK from the same node. Lambda MicroVMs are driven from a laptop, so every step after create carries a round trip of about 250 ms.

fastest groupslow or unevenincludes about 250 ms of network
SandboxReadyFirst commandWrite 1 MiB + syncPauseResume + read backStop or delete
runc pod7377397––42
gVisor pod7216569––44
Sysbox pod74181102––41
krun pod719no execno exec––55
Kata Cloud Hypervisor pod1,73687110––44
Kata QEMU pod3,68881102––42
Kata Firecracker pod3,7427376––41
Warm pool claim (any runtime)64–72as the runtimeas the runtime–––
E2B Embed1228.816.62631,5389.4
CubeSandbox165713244.5262197
microsandbox60817.118.5nonenone86
AWS Lambda MicroVMs (from a laptop)1,447511434461733130
  • Ranges: E2B create 54–300, resume 91–2,157; CubeSandbox resume 260–269; microsandbox create 603–640; Lambda create 1,161–1,880. Every row and its range is in the README of its results folder.
  • The first sandbox after an install is slower everywhere: CubeSandbox's first pause took 1,562 ms, and microsandbox's first create (which pulls the image) 1,706 ms.
  • E2B and CubeSandbox ran their vendor's Debian image, not our bench image; the pods and krun ran our bench image.

Data: bench/results/lanes/pod-start/round2-node-a-2 · krun/round2-node-a-3 · e2b-embed-1c2g/round2-node-b-2 · cubesandbox-1c2g/round2-node-b-2 · microsandbox/round2-node-a-3 · lambda-microvm/mac-1

kubernetes-sigs/agent-sandbox v1.0.2

Warm pools: the runtime stops mattering

A pool of 2 pods per runtime is kept running; a claim takes one. Cold is a new Sandbox started on request. Ready is stamped from a watch. Median (range) ms, 20 rounds. Every warm claim was a pool hit: the test waits for the pool to refill before each claim, so a burst that empties the pool (and falls back to the cold column) was not measured.

RuntimeCold (started on request)Warm (running pod handed over)
runc600 (531–1,558)72 (60–80)
gVisor577 (536–1,548)67 (63–84)
Kata Cloud Hypervisor2,565 (1,987–2,631)71 (64–112)
Kata QEMU3,592 (2,992–3,642)66 (59–97)
Kata QEMU, tuned3,588 (2,992–3,631)67 (61–76)
Kata Firecracker3,577 (2,992–3,639)64 (60–74)
  • About 47 ms of every warm claim is kubectl apply returning, so the hand-over itself is about 20 ms.
  • The price is idle pods: a pool of 2 holds 2 CPUs and 4 GiB per runtime whether or not anyone claims them.
  • Cold starts fall on steps of about 0.6 s and 1 s. That points at the kubelet or runtime path rather than VM boot; we didn't look further.

Data: bench/results/lanes/warm-pool/round2-node-a-2

crun 1.31 + libkrun 1.19.8

krun pods: a VM that starts like a container

RuntimeReadyDeleteFirst execWrite 1 MiB + sync
runc717 (636–782)44.5 (42–51)80 (74–91)90 (88–101)
krun719 (629–834)55 (49–65)not supportednot supported
  • kubectl exec fails: "the handler does not support exec". Our micro-benchmarks all run through exec, so krun has start and delete times only.
  • The CPU limit doesn't reach the VM. The guest saw all 4 of the node's CPUs; the 1 CPU limit is only the cgroup around the VM. Memory (about 1.98 GiB) did match.
  • No network card inside: libkrun passes sockets through to the host instead of giving the guest a NIC.
  • It took six attempts to build on Ubuntu (missing build tools, then libkrun 2.0 and crun's main branch not building together). lab/install/72-krun.sh now pins release tags.

Data: bench/results/lanes/krun/round2-node-a-3

E2B Embed v0.30 · memory sweep

E2B resume: uneven at every size

At 2 GiB, E2B's resume ranged from 91 ms to 2.2 s. To see if memory size was the cause, the same test ran at 1 vCPU with 512 MiB, 1 GiB and 2 GiB. Median (range) ms, 20 rounds each, 60 of 60 ok.

MemoryCreatePauseResume + read back
512 MiB105 (49–153)222 (141–2,410)891 (111–2,955)
1 GiB89 (51–271)169 (111–399)1,357 (91–1,853)
2 GiB149 (46–259)135 (40–423)1,519 (124–2,452)
  • The median resume rises with memory, but every size has resumes near 100 ms and resumes above 1.8 s. Memory size is not the main cause of the spread. The orchestrator logs around each resume are saved but not yet analysed.
  • 2 GiB sandboxes need a bigger hugepage pool than E2B reserves by default (2,048 pages); with the default, creates and resumes were refused.
  • A template built from our own bench image failed: the E2B SDK doesn't accept multi-stage Dockerfiles.

Data: bench/results/lanes/e2b-followup/round2-node-b-3

AWS Lambda MicroVMs · us-east-2

Lambda MicroVMs: suspend and resume, run by AWS

StepMedian (ms)Range (ms)
Create (until RUNNING)1,4471,161–1,880
Network round trip (GET /health)247222–260
First command511477–538
Write 1 MiB + sync434365–467
Suspend (until SUSPENDED)461429–745
Resume + read back733685–964
Terminate130121–611
  • Timed from a laptop on a home connection, not a machine in the Region. Take off the ~250 ms round trip from first command, write and resume before comparing; even then it isn't like for like. State changes were polled every 100 ms.
  • Not 1 CPU / 2 GiB. You can't choose CPU or memory when you start one; the image only sets a minimum memory (2,048 MiB here). The VM came up with 4 CPUs and about 7.8 GiB.
  • Every resource was deleted afterwards: 22 MicroVMs, the image, the build role, the bucket and the log group.

Data: bench/results/lanes/lambda-microvm/mac-1

Read with care

Caveats

  • One node type (m8id.xlarge) with nested KVM, so every VM here is a VM inside a VM. Bare metal would likely shorten the VM rows; see Bare Metal Analysis
  • These are start-path numbers only. File, network and CPU work inside these products was not measured, except through the probe.
  • Pod rows go through kubectl; product rows go through each product's SDK on the same node. The two kinds of client add different overheads.
  • CubeSandbox's disk was XFS on a loop file on the node's root EBS volume, not a dedicated disk.
  • Not done: Edera (skipped), hosted-only services, E2B on our exact bench image, analysis of E2B's resume logs, microsandbox and krun under the full workload set.