[pve-devel] [PATCH docs] Add section 'Compression in ZFS'
f.ebner at proxmox.com
Thu Jan 16 10:59:05 CET 2020
Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
local-zfs.adoc | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/local-zfs.adoc b/local-zfs.adoc
index 15a88bb..69979b5 100644
@@ -180,7 +180,7 @@ underlying disk.
zpool create -f -o ashift=12 <pool> <device>
-To activate compression
+To activate compression (see section <<zfs_compression,Compression in ZFS>>):
zfs set compression=lz4 <pool>
@@ -433,6 +433,31 @@ change-key` commands and the `Encryption` section from `man zfs` for more
details and advanced usage.
+Compression in ZFS
+You can enable compression on a ZFS dataset with:
+ zfs set compression=<algorithm> <dataset>
+The `lz4` algorithm is recommended, since it is highly performant. Other
+algorithms like `lzjb` and `gzip-N`, where `N` is an integer from `1`
+(fastest) to `9` (best compression ratio), are also available.
+Once enabled, ZFS compresses all *new* blocks before writing them (and
+decompresses them after reading). If your CPU can compress/decompress the
+data as quickly as it comes in, having compression enabled can even increase
+I/O performance. Data that existed before compression was enabled will not
+be compressed automatically.
+You can disable compression at any time with:
+ zfs set compression=off <dataset>
+Again, only new blocks will be afffected by this change.
ZFS Special Device
More information about the pve-devel