Skip to content

docs: Explain layer compression next to EROFS compression - #382

Draft
nurof3n wants to merge 1 commit into
prod-stagingfrom
nurof3n/docs/rootfs-compression
Draft

nurof3n wants to merge 1 commit into
prod-stagingfrom
nurof3n/docs/rootfs-compression

Conversation

@nurof3n

@nurof3n nurof3n commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Part of TOOL-1858.

  • Explains layer compression (unikraft build --compress) next to EROFS compression, with a table of what each one changes.
  • Adds cold start times with uncompressed, gzip and zstd layers, for EROFS and CPIO images.
  • Keeps the EROFS compression section, with small wording changes.

Depends on the --compress flag of the CLI and on platform support for compressed layers, which are not released yet.

@nurof3n
nurof3n temporarily deployed to pull-requests November 16, 2026 23:23 — with GitHub Actions Inactive
@github-actions
github-actions Bot temporarily deployed to pull-requests November 16, 2026 23:26 Inactive
@nurof3n
nurof3n marked this pull request as ready for review November 16, 2026 23:48
@nurof3n
nurof3n force-pushed the nurof3n/docs/rootfs-compression branch from 8f6079b to 4c31e7c Compare November 17, 2026 00:02
@nurof3n
nurof3n temporarily deployed to pull-requests November 17, 2026 00:02 — with GitHub Actions Inactive
@github-actions
github-actions Bot temporarily deployed to pull-requests November 17, 2026 00:05 Inactive
@nurof3n
nurof3n force-pushed the nurof3n/docs/rootfs-compression branch from 4c31e7c to 9a7dd5e Compare November 17, 2026 00:12
@nurof3n
nurof3n temporarily deployed to pull-requests November 17, 2026 00:12 — with GitHub Actions Inactive
@github-actions
github-actions Bot temporarily deployed to pull-requests November 17, 2026 00:16 Inactive
craciunoiuc
craciunoiuc previously approved these changes Nov 17, 2026

@craciunoiuc craciunoiuc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good here. Thanks!

Reviewed-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.com>
Approved-by: Cezar Craciunoiu <cezar.craciunoiu@unikraft.com>

@craciunoiuc

Copy link
Copy Markdown
Contributor

merge this once we have the flag

@jedevc
jedevc marked this pull request as draft November 17, 2026 09:25
@jedevc

jedevc commented Nov 17, 2026

Copy link
Copy Markdown
Member

Converting to draft until the --compress stuff is merged.

Comment thread pages/tutorials/rootfs-compression.mdx Outdated
Comment on lines +48 to +49
A node must support compressed layers to run the image.
Before you push compressed images to a BYOC or on-premises installation, make sure that its platform version supports them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ai: medium: An older agent skips a +zstd layer with no error, so a --compress image on a runtime such as base-compat pulls fine on an older node and the instance starts without its rootfs. "Make sure that its platform version supports them" gives the reader nothing to check against. Can we name the first release that pulls compressed layers, and say that an older node drops the rootfs silently?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: the note names the first release with compressed layers, and says that an older node starts the instance without its rootfs.

Comment thread pages/tutorials/rootfs-compression.mdx Outdated
| Decompression | Once, when the platform pulls the image | At each read, in the guest kernel |
| Cold start | Faster, because the download is smaller | Depends on how many files the instance reads |
| Warm start and file access | No change | Slower |
| `DAX` and shared initrd | Available | Not available |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ai: medium: This row says the shared initrd isn't available with EROFS compression, but the tip further down says that with the shared initrd, compressed and uncompressed EROFS boot almost the same, and ukpd passes --initrd-map-shared for every image. Which one is right? If the shared initrd works, mark only DAX as not available here and in the conclusion, otherwise fix the tip.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right: ukpd passes --initrd-map-shared to every VM when the node enables it, whatever the image. The table and the conclusion now mark only DAX as not available.

Signed-off-by: Alex-Andrei Cioc <andrei.cioc@unikraft.io>
@nurof3n
nurof3n force-pushed the nurof3n/docs/rootfs-compression branch from 9a7dd5e to 7e326a9 Compare November 26, 2026 13:33
@nurof3n
nurof3n temporarily deployed to pull-requests November 26, 2026 13:33 — with GitHub Actions Inactive
|----------------------------|-------------------------------------------|---------------------------------------------------|
| Compressed data | In the registry and on the network | In the registry, on the host, and in the instance |
| Decompression | Once, when the platform pulls the image | At each read, in the guest kernel |
| Cold start | Faster, because the download is smaller | Depends on how many files the instance reads |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[write-good.Adverbs] 'many' can weaken meaning

|----------------------------|-------------------------------------------|---------------------------------------------------|
| Compressed data | In the registry and on the network | In the registry, on the host, and in the instance |
| Decompression | Once, when the platform pulls the image | At each read, in the guest kernel |
| Cold start | Faster, because the download is smaller | Depends on how many files the instance reads |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[write-good.Weasel] 'many' is a weasel word

| Cold start | Faster, because the download is smaller | Depends on how many files the instance reads |
| Warm start and file access | No change | Slower |
| `DAX` | Available | Not available |
| Rootfs formats | EROFS and CPIO | EROFS only |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[write-good.Adverbs] 'only' can weaken meaning

| How to use it | `unikraft build --compress` | `mkfs.erofs -z` |

As a rule, use layer compression for all images.
Use EROFS compression only when the rootfs is too large for the host disk, or for the instance memory on nodes without `DAX`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[write-good.Adverbs] 'only' can weaken meaning


The table shows the cold start of four images, with uncompressed, `gzip` and `zstd` layers.
The cold start is the time from the request that creates the instance until the instance runs, when the image isn't on the node yet.
The node had an Intel Core i7-7700 CPU, NVMe disks, and approximately 90 MB/s of bandwidth to the registry.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[write-good.Adverbs] 'approximately' can weaken meaning

```

Finally, you can package and deploy the compressed EROFS rootfs using the CLI:
Finally, package and deploy the compressed EROFS rootfs with the CLI:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[write-good.Adverbs] 'Finally' can weaken meaning

With compression or without it, EROFS performs better than CPIO.
The compressed EROFS rootfs boots even faster than the uncompressed one.
This is likely due to the reduced amount of data that the system reads from disk, resulting in faster access times despite the decompression overhead.
The likely cause is that the system reads less data from disk, which saves more time than the decompression takes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[write-good.Adverbs] 'likely' can weaken meaning

:::tip
For BYOC or on-prem deployments, Unikraft Cloud offers the option to share the same read-only initrd between instances when using EROFS images.
This has the added benefit that Unikraft Cloud loads the initrd into host memory only once as read-only.
Unikraft Cloud then loads the initrd into host memory only once as read-only.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[write-good.Adverbs] 'only' can weaken meaning

:::tip
For BYOC or on-prem deployments, Unikraft Cloud offers the option to share the same read-only initrd between instances when using EROFS images.
This has the added benefit that Unikraft Cloud loads the initrd into host memory only once as read-only.
Unikraft Cloud then loads the initrd into host memory only once as read-only.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[write-good.Adverbs] 'only' can weaken meaning

Unikraft Cloud then loads the initrd into host memory only once as read-only.
Instances only map the pages they need, which reduces memory usage and boot times even further.
Upon writing, the system performs copy-on-write, meaning that it copies only the modified pages into the instance's memory.
When an instance writes, the system copies only the modified pages into the memory of the instance.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[write-good.Adverbs] 'only' can weaken meaning

@github-actions
github-actions Bot temporarily deployed to pull-requests November 26, 2026 13:36 Inactive

This branch was previously deployed

1 inactive deployment
pull-requests — 7e326a94 Deployed Nov 26, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants