Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it a good idea to compress rootfs in live-iso using zstd instead of gzip? #820

Open
hksdpc255 opened this issue Dec 25, 2024 · 1 comment

Comments

@hksdpc255
Copy link

Is your feature request related to a problem? Please describe.
There is a hard-coded gzip compression at line 95:

args := []string{
"mksquashfs",
tmpPaths[clrRootfs],
tmpPaths[clrCdroot] + "/images/rootfs.img",
"-b",
"131072",
"-comp",
"gzip",
"-e",
"boot/",
"-e",
"proc/",
"-e",
"sys/",
"-e",
"dev/",
"-e",
"run/",
}

Lots of benchmarks shows that zstd decompresion speed is much faster than gzip even using compression level 22:
https://gist.github.com/baryluk/70a99b5f26df4671378dd05afef97fce

Describe the solution you'd like
Zstd with compression level 22 will make the rootfs.img smaller but it will consume more memory when the kernel decompress it.

	args := []string{
		"mksquashfs",
		tmpPaths[clrRootfs],
		tmpPaths[clrCdroot] + "/images/rootfs.img",
		"-b",
		"131072",
		"-comp",
		"zstd",
		"-Xcompression-level",
		"22",
		"-e",
		"boot/",
		"-e",
		"proc/",
		"-e",
		"sys/",
		"-e",
		"dev/",
		"-e",
		"run/",
	}

Describe alternatives you've considered
Zstd with compression level 19 will make the rootfs.img small and fast, consuming resonable memory.

	args := []string{
		"mksquashfs",
		tmpPaths[clrRootfs],
		tmpPaths[clrCdroot] + "/images/rootfs.img",
		"-b",
		"131072",
		"-comp",
		"zstd",
		"-Xcompression-level",
		"19",
		"-e",
		"boot/",
		"-e",
		"proc/",
		"-e",
		"sys/",
		"-e",
		"dev/",
		"-e",
		"run/",
	}

Additional context
Currently, zstd support for mksquashfs in ClearLinux seems broken. clearlinux/distribution#3235
But I still believe compress rootfs using zstd is good for both performance and disk usage.

@fenrus75
Copy link

fenrus75 commented Dec 25, 2024 via email

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

No branches or pull requests

2 participants