LogoPegasus Docs

Squashfs Compression and Container Startup times

Squashfs Compression and Container Startup times

May 24, 2021, Joachim Folz

We tested container startup times from SquashFS with lz4 and zstandard compression versus uncompressed files. Spoiler: compression is good.

Benchmarks #

Enroot uses SquashFS as its container image format, which supports different lossless compression methods depending on the Linux kernel version. The newest addition is zstandard added in kernel 4.14. Below is are some results for nvcr.io_nvidia_pytorch_21.05-py3.sqsh with compressed size and startup times with different compression methods and threads available for decompression.

CompressionSize (GiB)ThreadsStart time (s)
none12230
none12430
none12830
lz46.7227
lz46.7421
lz46.7821
lz4 hc5.7224
lz4 hc5.7420
lz4 hc5.7820
zstd lvl 154.4229
zstd lvl 154.4421
zstd lvl 154.4817
zstd lvl 224.3230
zstd lvl 224.3422
zstd lvl 224.3818

Conclusion #

As we can see, zstandard provides best compression by a large margin, beating the second best entry lz4 hc (high compression) by about 23%. Zstandard is slightly slower than lz4 hc if only 2 threads are used for decompression, but they are comparable for 4 or more threads. Most importantly compression provides significant savings up to 64% in terms of storage space and is always faster than uncompressed images.