Default is that metadata is compressed, but your data is not. If you set lz4 then it will use lz4 on both data and metadata.
Very often compression will give you better performance due to small/less frequent IO required, and CPUs are pretty decent these days. But it
isn't very hard to find situations where the opposite is true. Even if you same mpeg files, which can not be compressed, lz4 will skip over the file data, but
keep compressing the metadata. Generally, it is a good thing to enable compression - but you could check for your specific data.
- Code: Select all
zpool set feature@encryption=disabled RAID_Z3
zpool set feature@encryption=enabled RAID_Z3
These calls talk about the pool feature, and is not how you change the compression type, and will do nothing if compression is not on.
- Code: Select all
zfs set compression=lz4 RAID_Z3
Will enable compression for the root dataset of the pool (and if you use inherit, lz4 for all lower dataset, unless specifically set to something
different).
Note that enabling compression (setting lz4) will NOT recompress everything on disk already. They will remain in whatever state that they are in.
Only NEW data will use the compression setting. So writing a new file, will then be lz4 compressed. This is also true when you
disable compression, any files with lz4 will remain compressed, and only new data will be uncompressed.
If you bench mark, create new dataset, set the compression level, then populate data for testing.