[SOLVED] Disable ZFS compression

Valerio Pachera

Active Member
Aug 19, 2016
131
6
38
42
Hi all, I created two zfs pools with compression active.
These pools are used by guests.
Swap and root filesystem are also hosted here.

Code:
tree /dev/zvol/
/dev/zvol/
├── rpool
│   ├── data
│   │   ├── vm-100-disk-1 -> ../../../zd0
│   │   └── vm-100-disk-1-part1 -> ../../../zd0p1
│   └── swap -> ../../zd16
└── tank
    ├── vm-100-disk-1 -> ../../zd48
    ├── vm-100-disk-1-part1 -> ../../zd48p1
    ├── vm-100-disk-1-part2 -> ../../zd48p2
    ├── vm-100-disk-2 -> ../../zd64
    ├── vm-100-disk-2-part1 -> ../../zd64p1
    ├── vm-101-disk-1 -> ../../zd32
    └── vm-101-disk-1-part1 -> ../../zd32p1

I think it's unwise to keep compression active for these reaons:
  • this kind of data probably doesn't compress very well (correct me if I'm wrong);
  • I/O will be slowed down;
  • zfs will require more ram to compress data
My main questions are:
  1. is it safe to run 'zfs set compression=off pool'?
  2. Is it better to shutdown the guest before doing that?
  3. What do you think about it?
Thank you.
 
turning off compression is completely safe. I personally have it enabled for all my VMs/containers since they compress somthing like 1.5x (which is really good) for linux .iso's i just turn compression off.

Code:
root@ryzen:~# zfs get compressratio
NAME                          PROPERTY       VALUE  SOURCE
rpool                         compressratio  1.28x  -
rpool/ROOT                    compressratio  1.58x  -
rpool/ROOT/pve-1              compressratio  1.58x  -
rpool/data                    compressratio  1.26x  -
rpool/data/subvol-100-disk-1  compressratio  1.80x  -
rpool/data/subvol-101-disk-1  compressratio  1.36x  -
rpool/data/subvol-102-disk-1  compressratio  1.64x  -
rpool/data/subvol-103-disk-1  compressratio  1.76x  -
rpool/data/subvol-104-disk-1  compressratio  1.68x  -
rpool/data/subvol-106-disk-1  compressratio  1.61x  -
 
I think it's unwise to keep compression active for these reaons:
  • this kind of data probably doesn't compress very well (correct me if I'm wrong);
  • I/O will be slowed down;
  • zfs will require more ram to compress data
My main questions are:
  1. is it safe to run 'zfs set compression=off pool'?
  2. Is it better to shutdown the guest before doing that?
  3. What do you think about it?
Thank you.
  • this kind of data probably doesn't compress very well (correct me if I'm wrong);
ZFS support various compression methods so you can choose your best option
  • I/O will be slowed down;
It will request less I/O for the same data read/write
  • zfs will require more ram to compress data
It request more CPU like for gzip compression but I never heard anything about ram usage problem.

1. is it safe to run 'zfs set compression=off pool'?

Yes. You can use '#zfs set option pool' in any time. As for compression or deduplication data after zfs option changes will stay as they are. Only new data writes or rewrites will be in new format ( compressed/uncompressed and so on)

2. Is it better to shutdown the guest before doing that?

Not needed.

3. What do you think about it?

Compression speeds up writes and reads. You can find comparison of compression

https://www.nas4free.org/wiki/zfs/compression/comparison
https://calomel.org/zfs_raid_speed_capacity.html
 
I don't use ZFS in Proxmox but if its defaulting to LZ4, I'm reading everywhere that overhead is very low and every recommendation is to leave it on.
 
Ok, I will not disable compression.
I'm experiences problems with a server using zfs but it seems related to zfs arc cache only.
Now I'm going to reduce zfs arc cache and move swap away from zfs.
If this will fix my problems, no need to disable compression.
Thank you all for your answers.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!