On Sun, Jan 5, 2020 at 5:24 AM Bohdan Khomutskyi <bkhomuts(a)redhat.com> wrote:
Improve compression ratio of SquashFS filesystem on the installation media.
On the issues of Fedora ISOs using excessive CPU, related to lzma decompression:
Create images using plain squashfs (without nested ext4)
And koji issue to enhance it so it can accept configurable rootfs
types (plain squashfs and configurable compression)
I'm wondering if you can relate this feature proposal to those issues
and feature requests?
In my testing, xz does provide better compression ratios, well suited
for seldom used images like archives. But it really makes the
installation experience worse by soaking the CPU, times thousands of
installations (openQA tests on every single nightly, every human QA
tester for nightlies, betas, and then the final released product used
by Fedora end users).
Has zstandard been evaluated? In my testing of images compressed with
zstd, the CPU hit is cut by more than 50%, and is no longer a
bottleneck during installations. Image size does increase, although I
haven't tested mksquashfs block size higher than 256K. Using zstd with
Fedora images also builds on prior evaluation, testing, and effort
moving RPM from xz to zstd.
My testing with mksquashfs block size suggests compression ratio
improves but latency gets worse, and becomes somewhat pathological
with a nested ext4 in it: my best guess is the random access nature of
ext4, many 4KiB seeks turn into larger 128KiB seeks; and also squashfs
and ext4 probably have different localities (where data is placed in
relation to their metadata, in attempt to optimize). Dropping the
nested ext4 image also improved performance quite a bit, independent
of compression algorithm. I forget how much exactly but it may be
I've pretty much concluded Fedora is best off dropping the nested ext4
in favor of plain squashfs, and using zstd. It's not required to do
both, but the benefit is additive and significant. The work in dracut
and lorax to support plain squashfs, assembling it using overlayfs
instead of device-mapper is already done, and tested.