Bare metal · no nested virtualization
Is the nested VM to blame?
Every Kata, Firecracker and gVisor KVM number on the Compare page was measured inside an EC2 VM, where the sandbox's own VM is nested. In iteration 5 the same tests ran on one m7i.metal-24xl (96 vCPU, Xeon 8488C, us-east-2), where it isn't. A small nested node ran the same commit and image in the same hours, so the two can be compared directly. The Costs numbers are unchanged; this page stands beside them.
Pods: 1 CPU / 2 GiB · containerd · 5 rounds + 1 warm-up (4 measured) · startup 10 rounds + 2 warm-up · disks are EBS gp3 at 3,000 IOPS / 125 MB/s · nested control: m7i.xlarge
Verdict
What bare metal changes, and what it doesn't
m7i.metal-24xl
Scorecard on bare metal: times slower than runc
1.0 is runc's speed on the same machine. 5× means five times slower, 0.5× twice as fast. Kernel-call rows were measured with all runtimes busy at once, each on its own cores; the other rows one runtime at a time. Kata Firecracker ran in a second pass and is compared with the runc pod that ran beside it.
| Task | runc + user ns | Sysbox | gVisor | gVisor KVM mode | Kata QEMU | Kata Cloud Hyp. | Kata Dragonball | Kata Firecracker |
|---|---|---|---|---|---|---|---|---|
| Start a pod, run one command (seconds added) | +0.3 s | +1.0 s | +0.3 s | +0.2 s | +1.7 s | +0.9 s | +1.8 s | +1.4 s |
| Cheapest kernel call | 0.93× | 0.91× | 65× | 4.7× | 0.58× | 0.57× | 0.58× | 0.65× |
| Open and close a file | 1.01× | 0.68× | 4.9× | 1.69× | 99× | 89× | 0.42× | 0.36× |
| Start a process (fork + wait) | 1.01× | 0.97× | 7.7× | 2.48× | 1.59× | 1.60× | 1.13× | 0.32× † |
| Run a program (exec) | 1.00× | 0.98× | 10× | 3.8× | 13× | 13× | 3.5× | 0.83× |
| Map and unmap memory | 1.01× | 0.97× | 27× | 8.5× | 0.71× | 0.74× | 0.71× | 0.73× |
| Unpack node_modules (container disk) | 1.06× | 0.98× | 3.4× † | 2.11× † | 37× | 36× | 35× | 0.53× |
| Clone a repo from a local copy (container disk) | 1.03× | 1.00× | 5.9× † | 2.88× † | 19× | 19× | 25× | 0.73× |
| git status (container disk) | 1.00× | 1.00× | 3.6× † | 2.00× † | 22× | 27× | 16× | 0.80× |
| Create 4,000 small files (volume) | 1.01× | 0.96× | 4.9× | 4.1× | 24× | 23× | 45× | 0.34× † |
| Save each write before the next (volume) | 0.99× | 1.01× | 1.02× | 0.98× | 1.03× | 1.03× | 1.07× | <0.01× † |
| Save each write before the next (container disk) | 0.99× | 0.93× | <0.01× † | <0.01× † | 1.02× | 1.02× | 1.06× | 6.8× |
| Read and write at random spots (volume) | 0.99× | 0.99× | 0.02× † | 0.02× † | 0.13× † | 0.11× † | 0.40× † | <0.01× † |
| Write a big file (volume) | 1.00× | 1.00× | 1.02× | 1.01× | 1.06× | 1.05× | 1.23× | – |
| Read a big file (volume) | 1.00× | 1.00× | 0.02× † | 0.02× † | 0.05× † | 0.06× † | 0.08× † | – |
| Send to the node, one stream | 0.99× | 0.95× | 4.2× | 3.8× | 3.9× | 33× | 3.6× | 3.3× |
| Receive from the node, one stream | 0.98× | 0.97× | 3.8× | 2.92× | 2.26× | 9.3× | 3.2× | 2.12× |
| Many small messages | 1.00× | 1.00× | 8.7× | 4.1× | 1.00× | 1.30× | 1.00× | 1.23× |
- † gVisor's container disk is memory by default, and Kata Firecracker's volume lives inside the guest because Firecracker can't share a folder. Random and big reads on gVisor and Kata come back from a cache. Kata Firecracker's guest has one CPU, which flatters the process-start test.
- Kata QEMU, Cloud Hypervisor and Dragonball beat runc on the cheapest kernel call because the guest kernel runs without the node's seccomp filter and audit hooks.
- Disk rows are limited by the EBS volume, not the machine: m7i metal has no local NVMe disk.
Same commit, same image, same day
Bare metal against nested: times slower than runc on each
Each pair compares a runtime with runc on the same machine: the metal node on the left, the nested m7i.xlarge on the right. Where the right number is bigger, nesting is making the sandbox look worse than it is.
| Task | gVisor KVM mode | Kata QEMU | Kata Cloud Hyp. | Kata Firecracker | ||||
|---|---|---|---|---|---|---|---|---|
| metal | nested | metal | nested | metal | nested | metal | nested | |
| Cheapest kernel call | 4.7× | 4.9× | 0.58× | 0.58× | 0.57× | 0.61× | 0.65× | 0.60× |
| Open and close a file | 1.69× | 2.32× | 99× | 141× | 89× | 146× | 0.36× | 0.37× |
| Run a program (exec) | 3.8× | 8.1× | 13× | 18× | 13× | 22× | 0.83× | 1.57× |
| Unpack node_modules (container disk) | 2.11× † | 4.4× † | 37× | 53× | 36× | 49× | 0.53× | 0.52× |
| Unpack node_modules (volume) | 4.4× | 13× | 44× | 68× | 42× | 61× | 0.42× † | 0.71× † |
| Clone a repo (volume) | 4.4× | 11× | 21× | 30× | 21× | 35× | 0.70× † | 0.91× † |
| Create 4,000 small files (volume) | 4.1× | 8.9× | 24× | 27× | 23× | 28× | 0.34× † | 0.62× † |
| Save each write before the next (container disk) | <0.01× † | <0.01× † | 1.02× | 1.09× | 1.02× | 1.06× | 6.8× | 4.2× |
| Send to the node, one stream | 3.8× | 4.1× | 3.9× | 7.3× | 33× | 38× | 3.3× | 9.3× |
| Receive from the node, one stream | 2.92× | 3.8× | 2.26× | 2.95× | 9.3× | 13× | 2.12× | 2.94× |
| Many small messages | 4.1× | 4.7× | 1.00× | 1.77× | 1.30× | 1.16× | 1.23× | 1.92× |
- File work through Kata's shared folder is slow on both. Nesting makes it 1.5–2× worse, not 20×.
- gVisor's KVM mode is the runtime that nesting hurts most on file work, because every file operation leaves and re-enters its guest.
- † as in the scorecard.
Pod to node, one TCP stream
Network: megabytes per second and VM exits
A VM exit is the CPU leaving the guest so the host can handle something, here a packet. Counted for the whole node while the network test ran.
| Runtime | Bare metal | Nested | ||||
|---|---|---|---|---|---|---|
| send MB/s | receive MB/s | VM exits/s | send MB/s | receive MB/s | VM exits/s | |
| runc | 5,358 | 5,460 | – | 5,494 | 5,594 | – |
| gVisor | 1,264 | 1,445 | – | – | – | – |
| gVisor KVM mode | 1,406 | 1,870 | 3,548 | 1,345 | 1,488 | 3,257 |
| Kata QEMU | 1,362 | 2,411 | 58,764 | 749 | 1,896 | 22,937 |
| Kata Cloud Hypervisor | 162 | 586 | 12,157 | 145 | 431 | 16,951 |
| Kata Dragonball | 1,506 | 1,732 | 49,357 | – | – | – |
| Kata Firecracker | 1,654 | 2,632 | 57,320 | 592 | 1,904 | 37,570 |
- Kata QEMU takes 58,764 exits a second on metal and 22,937 nested, yet moves almost twice the data on metal. Exits aren't fewer on metal; each one is cheaper, because a nested exit has to pass through two hypervisors.
- The test moves data between a pod and its own node through a bridge, not a network card. It measures the runtime's network path, not what a download from the internet would get.
Create a pod, run one command
Startup
| Runtime | Bare metal | Nested |
|---|---|---|
| runc | 2.3 s | 2.7 s |
| runc + user namespace | 2.6 s | – |
| Sysbox | 3.3 s | – |
| gVisor | 2.6 s | – |
| gVisor KVM mode | 2.6 s | 2.7 s |
| Kata QEMU | 4.0 s | 5.2 s |
| Kata Cloud Hypervisor | 3.2 s | 4.0 s |
| Kata Dragonball | 4.1 s | – |
| Kata Firecracker | 4.1 s | 5.2 s |
- Image already on the node, measured from creating the pod to its command finishing, one pod at a time.
No sandbox VM involved
Did nesting skew plain containers?
The node itself and runc, on metal and on the nested node. The last column of each group is how much slower the nested node is.
| Task | On the node, no container | runc | ||||
|---|---|---|---|---|---|---|
| metal | nested | nested slower by | metal | nested | nested slower by | |
| Cheapest kernel call (ns) | 74.0 | 97.2 | 1.31× | 101 | 111 | 1.10× |
| Open and close a file (ns) | 775 | 918 | 1.19× | 1,663 | 1,391 | 0.84× |
| Run a program (µs) | 292 | 426 | 1.46× | 315 | 380 | 1.21× |
| Unpack node_modules, container disk (ms) | 154 | 183 | 1.19× | 203 | 247 | 1.22× |
| Save each write, container disk (per s) | 372 | 348 | 1.07× | 373 | 328 | 1.14× |
| Send to the node (MB/s) | 5,536 | 5,904 | 0.94× | 5,358 | 5,494 | 0.98× |
| Start a pod (s) | – | – | – | 2.3 | 2.7 | 1.17× |
- A little. Most plain-container work is 1.0–1.4× slower on the nested node. That node is also much smaller (4 vCPUs against 96), so part of the gap is the machine, not nesting.
How one machine ran nine runtimes at once
Parallel lanes, and what they cost in accuracy
To keep the bill small, tests that only use CPU ran for every runtime at the same time. Each runtime's pod, with its VM and helper processes, was confined to its own two physical cores and had its own EBS volume. Tests that share a device (disk on the container's own filesystem, network, startup) ran one at a time. The table shows the same pod with eight busy neighbours against the same pod alone.
| Task | runc | Sysbox | gVisor KVM mode | Kata Cloud Hyp. |
|---|---|---|---|---|
| Cheapest kernel call | 1.12× | 1.03× | 1.01× | 1.00× |
| Open and close a file | 1.39× | 1.05× | 1.02× | 0.90× |
| Look up a file (stat) | 1.42× | 1.08× | 1.02× | 1.00× |
| Run a program (exec) | 1.13× | 1.06× | 1.00× | 1.01× |
| Read 4 KB | 1.07× | 1.08× | 1.01× | 1.12× |
| Unpack node_modules | 1.10× | 1.00× | 1.02× | 1.03× |
| Clone a repo | 1.00× | 1.05× | 0.99× | 1.06× |
| git status | 1.25× | 1.12× | 0.91× | 1.03× |
| git log | 1.00× | 1.25× | 1.03× | 1.66× |
- Runtimes with their own kernel (gVisor, Kata) barely notice their neighbours. Runtimes that share the node's kernel do: runc's file lookups were up to 1.4× slower, because separate cores don't separate the kernel's shared locks and caches.
- So in the scorecard, the kernel-call rows for runc, runc with a user namespace and Sysbox carry up to 1.4× of this on opening and looking up files. Rows measured one at a time don't.
- Kata Firecracker didn't start in the main pass: it refuses a host with more than 32 CPUs until its maximum is capped. It ran afterwards with one neighbour instead of eight.
Read with care
Caveats
- One Intel machine type in one Region, one run. Four measured rounds per cell; eight for startup.
- AMD and Graviton hosts aren't covered. AWS offers no nested virtualization on them, so bare metal is the only way to run Kata there.
- The nested control is a 4-vCPU m7i.xlarge, not the m7i.2xlarge and m8i nodes behind the Compare page, and it ran six of the ten runtimes.
- Kata Firecracker ran with its jailer off so that flushes reach the disk, as on the Compare page.
- The whole run cost about $12: 2 h 15 min of the metal machine and a small build node.
To be done
Second pass with tuned settings: TBD
Not run yet. Everything above is the first pass, with each runtime's default settings. The Tuning page shows what changed settings do inside an EC2 VM; the same settings have not been measured on bare metal. This run is on hold to keep AWS spend low, and this section will be replaced by its results.
- Kata with the tuned recipe (block devices for the container disk and volumes, one vCPU, the sandbox's own CPU declared as pod overhead): TBD.
- gVisor in KVM mode with huge pages for shared memory and every mount overlaid inside the sandbox: TBD.
- Why two vCPUs cost Kata so much: whether the host delivers cross-CPU wake-ups without leaving the guest on metal, and which virtio mode QEMU uses there: TBD.
- Kernel-call rows measured one at a time, to replace the ones that carry up to 1.4× from parallel lanes: TBD.