3 ms·
Using compress=zstd on system root saves me about 35-40%. And I save about 1/2 the space if I use compress-force=zstd mount option. I do this on computers with
by cmurf 8y ago
Using compress=zstd on system root saves me about 35-40%. And I save about 1/2 the space if I use compress-force=zstd mount option. I do this on computers with SDHC/SDXC cards which have dog slow writes and lots of spare CPU time, and some of the time on HDD. I don't use compression on computers with NVMe, it doesn't appear to help much at all, and also I'm pretty sure the compression is currently a single threaded pipe, so for multi-queue devices it's plausible some workloads could become slower.
Another use case, soonish I hope to see support for selectable compression levels for zstd (currently only with zlib). And also zstd supports use of a training file for even higher ratios. Both would work well for archiving and seed/sprout use cases, where taking the heavy front end hit with slow writes will be worth it (faster download times, and of course the sprout can have a different compression level or no compression so subsequent writes can be fast.
Latest squashfs support includes zstd and also selectable levels, if you need a read-only image.
- shmerl 8y agoDo they plan to implement multithreaded compression / decompression?
- terrelln 8y agoBtrfs already supports multithreaded compression and decompression. Each 128 KB block is (de)compressed with a single thread, but multiple blocks can be (de)compressed in parallel. The zstd CLI supports multithreaded compression with the flag `-T <num-threads>`.
- shmerl 8y agoGood to know, thanks! Can you add that info to btrfs wiki compression page, please[1]? 1. https://btrfs.wiki.kernel.org/index.php/Compression https://btrfs.wiki.kernel.org/index.php/Compression
- terrelln 8y agoI implemented zstd compression in btrfs/squashfs, and work on upstream zstd. * Btrfs compression is multithreaded, and can use up to the number of cores available on the system. * Compression might not help speed on SSDs, but it should help reduce the burn rate, if you care about that. * My intern wrote a patch to add compression level support to zstd in btrfs [1]. It should be merged upstream soon. * Slightly off topic, but grub will soon understand btrfs compressed with zstd. [1] https://lore.kernel.org/linux-btrfs/20181031181108.289340-1-terrelln@fb.com/ https://lore.kernel.org/linux-btrfs/20181031181108.289340-1-...