Just curious as to why for the default install, compression is on by default for ZFS? Would be nice for this to be turned off on root by default.
File storage vs. CPU vs. Memory - I'm not sure burning up CPU cycles and RAM for decompressing your OS base file system is such a good idea. I do see CPU and memory utilized for this purpose off of a really tight, compact boot up. overhead is not negligible vs. ram used and cpu used - it can be measured well over 1% and is not and should not be required for out the box raw setup.Compression is at the very foundation of ZFS.
It is enabled by default because it enhances the efficiency and performance of file systems and storage.
Since it reduces the amount of disk space needed to store data, it improves read/write performance in some cases. (As data takes up less space, there is less data to read and write, and since the time needed to compress and decompress data is less than the time saved for read/write operations, this results in a performance increase)
Given that our current CPUs are very efficient at these types of tasks, the overhead of compression is negligible compared to the performance gain. It also saves bandwidth during network transfers.
It's not about skepticism - The fact is FreeBSD runs out of the box 100 MB or so in ram, which is the comparison, again I would have to ask why the root executable code would need to be compressed and uncompressed etc. It makes no sense and has no benefit to the comparison at all for base install.I also was skeptical at first but it should be the default for any machine with 4 or more CPU's. Compression is really cheap. That's why I enable it not just on filesystems but also on memory in Linux (zram as swap).
No. Even SSDs These days deliver data at a snails pace when viewed from the CPU memory bus. You may need a second to read, say, one GB of data. Now you read one GB of compressed data and decompress in 0.1 seconds to two GB. That's a nice improvement and no waste at all.It fits in the realm of waste, bloat in terms of relativity etc. which I'm guessing could be easily fixed by simply not having it on.
The potential performance benefits of compression are significant, and the worst-case penalties are quite small. There are almost always better places to focus a sysadmin or storage architect’s attention than picking and choosing which datasets to disable compression on, so we recommend defaulting to LZ4 by setting “compress=lz4” at the pool root and leaving that value inheritable.
Some extra details: currently data in the ZFS ARC is stored compressed by default*; this can be disabled by setting the tunable[...] The compression/decompression should only be happening on blocks written/read from the devices.
compressed_arc_enabled=0
. There is an open issue Should compressed ARC be mandatory? about this part of the "compression chain".I don't disagree with this but would point out:I just don't think the core boot-up it's useful and just a waste.
It's undeniable that ZFS takes up extra resources*. However, if you're confronted with a minimalistic system that is based on reasonably current hardware, my take is that probably one the most often encountered limiting resource is the amount of available RAM (not CPU power; note FreeBSD 32-bit support is dimishing). If RAM is an impeding factor, then you probably need to (heavily) tune your ZFS set-up; as a practical matter the obvious option to consider is not to use ZFS, but instead use venerable UFS[...] This just happens to be one of my gripes with ZFS for root - given how minimalistic the install is without using little to no resources.
"This allows for a coherent vision."The uniform approach in managing compression seems to me a good way to balance the benefits and challenges.
Having compression enabled by default while allowing adjustments at the dataset level offers a wide margin for customization without introducing excessive complexity.
This allows for a coherent vision.
One should not view compression solely from the perspective of system boot, but rather in terms of efficiency and overall performance in the long term.
We are talking about servers that often benefit from extended periods of activity, and in this context, the initial drawbacks seem to be completely outweighed by this choice.
In such a special case, yep, compression doesn't buy anything. It's still very unlikely to hurt performance, decompressing is done "on the fly" while reading. It's just a bit of unnecessary CPU work going on. Chances are it will just idle a bit more when you disable compression ... but then, you might save a bit of energy (which is a good thing as well)My use is entirely 20 to 50 gb movies already compressed in H264 or H265 format so I have compression disabled on those pools.
It's undeniable that ZFS takes up extra resources*. However, if you're confronted with a minimalistic system that is based on reasonably current hardware, my take is that probably one the most often encountered limiting resource is the amount of available RAM (not CPU power; note FreeBSD 32-bit support is dimishing). If RAM is an impeding factor, then you probably need to (heavily) tune your ZFS set-up; as a practical matter the obvious option to consider is not to use ZFS, but instead use venerable UFS
___
* given its "founding design principles" I'd say that it's not squandering resources, but from its design point of view and implementation it is not aimed at minimalistic syste
That's what I remember that toggling only applies to newly written files, currently compressed files will not change. This would be good enough reason for me to have it off by default and maybe some testing. It's been a while since Ive done anything with ZFS ... Thanks for the information.You can always toggle off compression in the installer or later if you do not like it. Toggling it later only applies to newly written files so your currently compressed content will not change until you 'replace' it through upgrades, manual replacement, etc. There is also zle as a compression option to just avoid writing strings of zeros to disk