Page 1 of 1

ZStandard as file compression option in BTRFS

Posted: 26 Nov 2023, 16:04
by 4lpha0ne
Hi, I love to have the file system compression option in TOS5 with BTRFS. It is also good to have a compression level option for ZLib (which is being used as I checked via SSH). Their use in BTRFS is documented here:
https://btrfs.readthedocs.io/en/latest/Compression.html

There are lots of charts online, where one can see, that ZStandard will compress and decompress much faster than ZLib at the same compression rates, which might avoid bottlenecks when writing on HDDs or SSDs in a RAID with combined write throughput of >300 MB/s.

The easiest way of implementing this I can imagine would be to change the compression level options from 1, 2, 3... to combinations like ZLIB-1, ZLIB-2,.. ZStd-1, etc.

Or is there a way to modify the way how the volume is mounted and provide the compression method there?

Re: ZStandard as file compression option in BTRFS

Posted: 27 Nov 2023, 14:45
by TMroy
Thank you! we will add it to the wish list.

Re: ZStandard as file compression option in BTRFS

Posted: 28 Nov 2023, 15:58
by 4lpha0ne
TMroy wrote: 27 Nov 2023, 14:45 Thank you! we will add it to the wish list.
Sounds good! Thank you very much!

I also looked for some more tests of all of the BTRFS compression method options, and it looks like LZO might also be useful for some scenarios.

Re: ZStandard as file compression option in BTRFS

Posted: 26 Apr 2025, 17:06
by never75
Hi,
Tahnks for the continuos updates to TOS . I bought a F8 nas and i am exploring the possibility to compress files to save money on expensive SSD and preserve their life, by reducing the amount of date written.

I checked the current version of TOS6 and compression is listed possible with level between 1 to 6 with 4 being default.
I get from the previous message that TOS6 use Zlib which has level from 1 to 9.

Can you confirm that level 1 to 6 listed in TOS6 map to level 1 to 6 of Zlib? If so, I understand why levels 7 to 9 have not been added. I believe because of the minimal, if any improvement, and the impact on the low power CPU used in nas system.

Also, any update on being able to use different compression algorithm like Zstandard?

Re: ZStandard as file compression option in BTRFS

Posted: 27 Apr 2025, 18:43
by TMzethar
never75 wrote: 26 Apr 2025, 17:06
Still under discussion and investigation.

Re: ZStandard as file compression option in BTRFS

Posted: 16 Dec 2025, 23:13
by marcusvictor
+1