The "common answer" is always set lz4 unless you know the data is not compressible (e.g. most video streams, already-compressed data archives, etc.) because ZFS will attempt it, bail early if it detects non-compressible data, and thus the loss is small but the potential gain (in storage capacity) is real and material.
But over on the various mailing lists for zfs 2.2 is some rather nebulous notes about zstd-9 being able to behave the same way; checking first if it will compress with lz4, then zstd-1 and only if both succeed then go ahead and use it on that block, otherwise not. Zstd-9 is quite resource intensive to compress but the level of zstd compression doesn't impact reads to any material degree so if it can bail fast and early this might be a significant win for compressible data sets over the default and worth the CPU expenditure, particular if I'm writing to a multi-vdev set of mirrors which is all spinning rust, and therefore physical transfer rate is likely the limiting factor.
Is this in the current code or is the answer still "use lz4 except in special circumstances"? Its not clear at all whether that's the case from what I can determine, but stable/14 did import the 2.2 code from upstream.
If you know, thanks in advance!
But over on the various mailing lists for zfs 2.2 is some rather nebulous notes about zstd-9 being able to behave the same way; checking first if it will compress with lz4, then zstd-1 and only if both succeed then go ahead and use it on that block, otherwise not. Zstd-9 is quite resource intensive to compress but the level of zstd compression doesn't impact reads to any material degree so if it can bail fast and early this might be a significant win for compressible data sets over the default and worth the CPU expenditure, particular if I'm writing to a multi-vdev set of mirrors which is all spinning rust, and therefore physical transfer rate is likely the limiting factor.
Is this in the current code or is the answer still "use lz4 except in special circumstances"? Its not clear at all whether that's the case from what I can determine, but stable/14 did import the 2.2 code from upstream.
If you know, thanks in advance!