]> git.proxmox.com Git - pve-docs.git/commitdiff
Add section 'Compression in ZFS'
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 16 Jan 2020 12:15:44 +0000 (13:15 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 16 Jan 2020 18:07:10 +0000 (19:07 +0100)
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
local-zfs.adoc

index 15a88bbc9753ea9b95e8d666a06ceb7fc0de8f82..7043a245f97b21ec197781a52ff53702ea0b6cd6 100644 (file)
@@ -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,35 @@ change-key` commands and the `Encryption` section from `man zfs` for more
 details and advanced usage.
 
 
+[[zfs_compression]]
+Compression in ZFS
+~~~~~~~~~~~~~~~~~~
+
+When compression is enabled on a dataset, ZFS tries to compress all *new*
+blocks before writing them and decompresses them on reading. Already
+existing data will not be compressed retroactively.
+
+You can enable compression with:
+
+----
+# zfs set compression=<algorithm> <dataset>
+----
+
+We recommend using the `lz4` algorithm, because it adds very little CPU
+overhead. Other algorithms like `lzjb` and `gzip-N`, where `N` is an
+integer from `1` (fastest) to `9` (best compression ratio), are also
+available. Depending on the algorithm and how compressible the data is,
+having compression enabled can even increase I/O performance.
+
+You can disable compression at any time with:
+
+----
+# zfs set compression=off <dataset>
+----
+
+Again, only new blocks will be affected by this change.
+
+
 ZFS Special Device
 ~~~~~~~~~~~~~~~~~~