[SOLVED] Disable ZFS compression

Discussion in 'Proxmox VE: Installation and configuration' started by Valerio Pachera, Sep 3, 2017.

  1. Valerio Pachera

    Joined:
    Aug 19, 2016
    Messages:
    131
    Likes Received:
    2
    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.
     
  2. vooze

    vooze Member

    Joined:
    May 11, 2017
    Messages:
    77
    Likes Received:
    17
    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  -
     
  3. Nemesiz

    Nemesiz Active Member

    Joined:
    Jan 16, 2009
    Messages:
    677
    Likes Received:
    42
    • 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
     
  4. Digitaldaz

    Digitaldaz Member

    Joined:
    Feb 19, 2014
    Messages:
    31
    Likes Received:
    1
    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.
     
  5. Valerio Pachera

    Joined:
    Aug 19, 2016
    Messages:
    131
    Likes Received:
    2
    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.
     
  6. Nemesiz

    Nemesiz Active Member

    Joined:
    Jan 16, 2009
    Messages:
    677
    Likes Received:
    42
    ZFS ARC cache impact ZFS performance. More is better.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice