4 ms·
Some statistics about BTRFS compression
- 5e92cb50239222b 4y agobtrfs has had support for changing the compression level for some years. I've been using zstd:2 (the default is 3), it compresses my data close to what zlib does while being pretty light on CPU. https://docs.google.com/spreadsheets/d/1x9-3OQF4ev1fOCrYuYWt1QmxYRmPilw_nLik5H_2_qA/edit?usp=sharing https://docs.google.com/spreadsheets/d/1x9-3OQF4ev1fOCrYuYWt... (not mine) https://linuxreviews.org/Comparison_of_Compression_Algorithms https://linuxreviews.org/Comparison_of_Compression_Algorithm... Also note that btrfs compression works on 128 KiB chunks and if you work with small files a lot (frontend work, etc), it may actually increase your SSD wear. I've seen this in practice.
- PaulKeeble 4y agoI use ZFS with LZ4 compression on my storage pool for NAS purposes, so its mostly music, movies and game stuff and it has an impressive 1.00x compression ratio, its not saved even 1%.
- masklinn 4y agoSeems unsurprising, as your data is already compressed. I would have expected some savings from games but mayhaps not from lz4. Music and movies though, if lz4 had significant savings to provide these would have long been added to the media formats (likely in a more specialised and effective or efficient form).
- soupbowl 4y agoIf compression was enabled after the data was written it will not be compressed until the data is written again. Just some info not sure if it applies to your compression level situation or not.
- spullara 4y agoFor that kind of data I am surprised LZ4 isn't making it bigger unless ZFS declines to store the compressed version when it does.
- rdc12 4y agoThat is correct, if the first few records (a virtual block size sorta) (not sure how many off the top of my head) don't compress well, it assumes that the file is not compressible and just writes the data out skipping the compression step.
- demindiro 4y agoStats for my desktop PC (ZFS with LZ4): david@pc1:~$ /sbin/zfs get compressratio rpool tank NAME PROPERTY VALUE SOURCE rpool compressratio 1.93x - tank compressratio 1.20x - rpool contains the root filesystem and my home directory. tank contains movies, music, recordings and backups.
- sleepycatgirl 4y agoMood It is impressive how much space you can save, with minimum CPU cost (It is there, but modern CPUs are so fast, well.. its okay) I run NixOS, and on /nix/store itself, i get 2.32x compressratio :D
- heywire 4y agoOnly somewhat related: My personal laptop is an older Dell Latitude 7370 (m7-6Y75) running Fedora 36. I had to reinstall using ext4 due to the performance impact of the default btrfs w/ compression. I was surprised at the difference it made. My disk throughput was nearly half.
- andrewmackrodt 4y agoI'm using btrfs for the first time (Ubuntu 22.04) and noticed that the performance is hugely reduced versus ext4, especially in kernels prior to 5.17. This was most evident installing papiris-icon-theme; there was a bug/inefficiency in how btrfs handles lots of files in the same directory. This has been fixed in 5.17, and while still slower than ext4 overall, for day-to-day usage (developer and gaming via steam/proton) I will stick with it for the ability to create snapshots.
- Krisjohn 4y agobtrfs is a horrible mess that will likely lose your data. For the few production systems we implemented it on, every single normal failure that other file systems can recover from had resulted in complete loss. We've had to implement a project to rebuild all systems that used btrfs in order to remove it.
- zionic 4y ago>btrfs is a horrible mess that will likely lose your data. Meanwhile the bazillion petabytes on the world's synology NAS run fine, and are BTRFS.
- yjftsjthsd-h 4y agoIsn't synology running it hybridized with their own proprietary storage layer?
- zionic 4y agoIt's not proprietary, you can hook up the drives to a linux box and pull files off them just fine if your box dies. I've never had to do this, but I've seen others say they've done so successfully.
- ThatPlayer 4y agoI believe it's a layer of mdadm and lvm rather than anything proprietary.
- 8fingerlouie 4y agoI could be wrong, but i think i remember that they have made some "magic" inside mdadm or lvm to allow btrfs self healing to work, and bypass the normal lvm self healing. They tooted something around the release of DSM 7 that Btrfs now used native self healing instead of relying on lvm, but of course i can't find any documentation for it.
- chasil 4y ago
- nhoughto 4y agoNo mention of if it’s force compression or not. Normal Btrfs compression can be unsuitable for some workloads where the beginning of files doesn’t compress but the rest does, Btrfs won’t compress the file if it appears pointless. Confused me when I tested it and can make a big difference! https://btrfs.readthedocs.io/en/latest/Compression.html https://btrfs.readthedocs.io/en/latest/Compression.html
- viraptor 4y agoDoesn't seem forced. The command listed is "btrfs filesystem defrag -czstd -r /" and the results include the "none" compression. That means most likely some files were rejected.