Skip to content

Commit 16061fb

Browse files
authored
Why Overlaybd for Virtual Machines (#439)
1 parent a536e33 commit 16061fb

4 files changed

Lines changed: 338 additions & 17 deletions

File tree

docs/README.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ The project has been integrated by many organizations world-wide, most notably
2222
[Databricks](https://www.databricks.com/blog/booting-databricks-vms-7x-faster-serverless-compute) +
2323
[Superhuman](https://www.databricks.com/blog/how-superhuman-and-databricks-built-200k-qps-inference-platform-together),
2424
[DeepSeek Elastic Compute (DSes)](https://arxiv.org/html/2606.19348v1),
25+
[Flatcar Container Linux](https://www.flatcar.org/docs/latest/os-config/network/overlaybd-artifact-streaming/),
2526
[fly.io](https://community.fly.io/t/experimental-speedy-machine-creation-with-overlaybd/18958),
26-
[hocus.dev](https://hocus.dev/blog/virtualizing-development-environments), etc.
27+
[hocus.dev](https://hocus.dev/blog/virtualizing-development-environments),
2728
[Kimi AgentEnv](https://kvcache.ai/blog/agentenv-open-sourced/),
28-
Overlaybd can also be used for virtual machines or micro sandboxes.
29+
etc. Overlaybd can also be used for virtual machines or micro sandboxes.
2930

3031
<!-- Boss直聘, -->
3132

@@ -183,12 +184,14 @@ the world:
183184
portfolio — Taobao, TMall, AlibabaCloud and more — and commercialized on AlibabaCloud as
184185
its container image acceleration offering, adopted by major customers worldwide.
185186

186-
- **Adopted across the industry**: Integrated by organizations including
187+
- **Adopted across the industry**: Integrated by organizations including (but not limited to)
187188
[Azure Kubernetes Service (Artifact Streaming)](https://learn.microsoft.com/en-us/azure/aks/artifact-streaming-overview),
188189
[Databricks](https://www.databricks.com/blog/booting-databricks-vms-7x-faster-serverless-compute),
189190
[DeepSeek Elastic Compute](https://arxiv.org/html/2606.19348v1),
191+
[Flatcar Container Linux](https://www.flatcar.org/docs/latest/os-config/network/overlaybd-artifact-streaming/),
190192
[fly.io](https://community.fly.io/t/experimental-speedy-machine-creation-with-overlaybd/18958),
191-
and [hocus.dev](https://hocus.dev/blog/virtualizing-development-environments).
193+
[hocus.dev](https://hocus.dev/blog/virtualizing-development-environments),
194+
etc.
192195

193196
- **Peer-reviewed research**: The design is documented in two USENIX Annual Technical
194197
Conference papers — [DADI](https://www.usenix.org/conference/atc20/presentation/li-huiba)
@@ -268,6 +271,28 @@ used by agent-sandbox systems in production.
268271

269272
Read the full article: [Why Agent Sandboxes Should Use Overlaybd](sbimg.md)
270273

274+
## for Virtual Machines
275+
276+
VM platforms need fast boot from shared base images, low per-VM
277+
metadata memory at high density, cheap snapshot and clone, and
278+
registry-style layered distribution.
279+
280+
The incumbent VM disk formats — qcow2, VHD/VHDX, and VMDK — all rely
281+
on per-file allocation tables chained one file per snapshot. Reads
282+
walk the chain, per-file index caches multiply with chain depth, and write
283+
cost is set by a fixed cluster size that trades directly against
284+
index size.
285+
286+
OverlayBD replaces the per-file tables with a single merged,
287+
extent-based index per device: O(1) lookup at any chain depth, an
288+
index small enough to stay memory-resident regardless of snapshot
289+
count, and 512-byte-granularity writes with no copy-on-write. Its
290+
image layout follows the OCI image spec — a base image is stored
291+
once, shared by every derivative VM, and distributed through the
292+
existing registry ecosystem.
293+
294+
Read the full article: [Why Virtual Machines Should Use Overlaybd Images](vmimg.md)
295+
271296
# Components
272297

273298
## Overlaybd service
@@ -318,6 +343,7 @@ Uses the P2P protocol to speed up HTTP file download for registry in large-scale
318343
<a href="https://www.deepseek.com" target="_blank"><img src="assets/logos/deepseek.svg" alt="DeepSeek"></a>
319344
<!-- <a href="https://www.dewu.com" target="_blank"><img src="assets/logos/dewu.png" alt="Dewu"></a> -->
320345
<a href="https://www.ele.me" target="_blank"><img src="assets/logos/eleme.svg" alt="Ele.me"></a>
346+
<a href="https://www.flatcar.org" target="_blank"><img src="assets/logos/flatcar.svg" alt="Flatcar"></a>
321347
<a href="https://fly.io" target="_blank"><img src="assets/logos/flyio.svg" alt="Fly.io"></a>
322348
<a href="https://hocus.dev" target="_blank"><img src="assets/logos/hocus.png" alt="Hocus"></a>
323349
<a href="https://www.kimi.com" target="_blank"><img src="assets/logos/kimi.png" alt="Kimi"></a>

docs/ctimg.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,13 @@ read miss walks the chain downward — O(n) in the number of layers.
139139
conform to the layered-image model.)
140140

141141
The second is the index. Data is located through a two-level L1/L2
142-
mapping table that grows with the virtual disk — at the default 64 KB
143-
cluster size, roughly 12.5 MB for a 100 GB image. Keeping the whole table resident
144-
for every VM is too expensive at density, so qemu caches only about
145-
1 MB of it by default, leaving operators stuck between two losses:
146-
enlarge the cache and waste host memory, or keep it small and waste
147-
I/O on table entries that miss the cache.
142+
mapping table that grows with the data stored — roughly 12.5 MB per
143+
100 GB of data at the default 64 KB cluster size — and every file in
144+
a backing chain carries its own table and its own cache, so the
145+
footprint multiplies with chain depth. QEMU sizes each file's cache
146+
to cover its whole table, up to 32 MB by default, leaving operators
147+
stuck between two losses: keep the caches and spend host memory, or
148+
shrink them and waste I/O on table entries that miss the cache.
148149

149150
The third is write overhead. Writes are copy-on-write at cluster
150151
granularity: a write allocates a new cluster, copies the original
@@ -264,6 +265,8 @@ This is not a theoretical argument. Overlaybd is deployed at scale today.
264265
also adopted Databricks' infrastructure to build a 200K QPS inference
265266
platform.
266267

268+
- [And more...](?id=who-uses-overlaybd)
269+
267270
### Peer-reviewed research
268271

269272
The design is documented in two USENIX Annual Technical Conference

docs/sbimg.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,14 @@ instances amplify every inefficiency:
110110
ever-growing penalty.
111111

112112
- **Index memory at density (qcow2).** qcow2 uses a two-level L1/L2
113-
mapping table to locate each 64 KB cluster. For a 100 GB image this
114-
table is ~12.5 MB, yet QEMU's default L2 cache is only 1 MB —
115-
covering roughly 8% of the table. Random I/O therefore triggers
116-
frequent L2 page eviction and reload. The operator faces a dilemma:
117-
raise the per-VM cache to the full 12.5 MB and hundreds of VMs consume
118-
gigabytes of host memory in metadata alone, or keep the default and
119-
accept constant cache misses on every I/O path.
113+
mapping table to locate each 64 KB cluster. For 100 GB of data this
114+
table is ~12.5 MB — and every file in a backing chain keeps its own
115+
table and cache, so a chain of n layers multiplies the footprint
116+
by n. QEMU sizes each file's L2 cache to cover its whole table, up
117+
to 32 MB by default. The operator faces a dilemma:
118+
keep the defaults and hundreds of VMs consume
119+
gigabytes of host memory in metadata alone, or shrink the caches and
120+
accept frequent L2 eviction and reload on every I/O path.
120121

121122
- **Cold-start latency (OCI tar + gzip).** The standard container image
122123
requires downloading, decompressing, and extracting every layer before

0 commit comments

Comments
 (0)