containers / initoverlayfs

GNU General Public License v2.0
35 stars 9 forks source link

erofs with -zlz4hc compression #18

Closed ericcurtin closed 7 months ago

ericcurtin commented 7 months ago

Read speed is enhanced by compression leading to faster boot. Tested on Raspberry Pi 4. Some older such as the CentOS Stream/RHEL 9 and earlier versions do not have decompression support. When generating configuration for these platforms, have compression off by default, for all other platforms have compression on by default.

ericcurtin commented 7 months ago

Here are some results:

storage-init-lz41.txt:[   32.397148] fedora systemd[1]: Reached target multi-user.target - Multi-User System.
storage-init-lz42.txt:[   34.017752] fedora systemd[1]: Reached target multi-user.target - Multi-User System.
storage-init-lz43.txt:[   33.445357] fedora systemd[1]: Reached target multi-user.target - Multi-User System.
storage-init-lz44.txt:[   33.217891] fedora systemd[1]: Reached target multi-user.target - Multi-User System.
storage-init-lz45.txt:[   32.816748] fedora systemd[1]: Reached target multi-user.target - Multi-User System.
storage-init-nolz41.txt:[   33.174182] fedora systemd[1]: Reached target multi-user.target - Multi-User System.
storage-init-nolz42.txt:[   34.621386] fedora systemd[1]: Reached target multi-user.target - Multi-User System.
storage-init-nolz43.txt:[   35.104990] fedora systemd[1]: Reached target multi-user.target - Multi-User System.
storage-init-nolz44.txt:[   34.777152] fedora systemd[1]: Reached target multi-user.target - Multi-User System.
storage-init-nolz45.txt:[   39.426255] fedora systemd[1]: Reached target multi-user.target - Multi-User System.

the top 5 are boots with "lz4hc" on.

rhatdan commented 7 months ago

Never crazy about kernel checks, since this can lead to RHEL systems with back ports not being supported. Would it make sense to first attempt the compression and then fall back to non-compression if it failed?

ericcurtin commented 7 months ago

@rhatdan yeah the kernel version check isn't spectacular. The thing is, if this was RHEL9, I would expect compressing the erofs filesystem to work as it's likely using a userspace tool. But the boot would fail, as we have not backported kernelspace erofs compression/decompression (which is a pity, even for things like composefs), reading this:

https://sigma-star.at/blog/2022/07/squashfs-erofs/

and doing my own benchmarks, IO speeds with compression on are much faster.

But you are right, lets make this better, even if it's a configuration option.

rhatdan commented 7 months ago

Hopefully we get the compression improvements in for RHIVOS though.

ericcurtin commented 7 months ago

Changed the check to be, if RHEL9 or less, have compression off by default. Still not perfect, but better, at least it's container friendly. It's hard to have a bulletproof technique to tell if the final runtime kernel will have support (especially when we integrate with ostree and the build/runtime machines are separate machines).

rhatdan commented 7 months ago

LGTM Although tests are failing.

ericcurtin commented 7 months ago

shellcheck failures, we actually never got those passing in the first place when we merged shellcheck, it's to be completed