ZFS ashift defaults & ZFS compression or not on encrypted VM disk storage question

GadgetPig

Member
Apr 26, 2016
138
26
18
54
Hello friends,

I have 2 questions.

My first question is about ZFS ashift. I was following this thread about ZFS and default ashift value of 9 vs 12 for zpools. https://github.com/zfsonlinux/zfs/issues/6373
Regarding ZFS on Linux used in Proxmox 5.1, is it true that when you create a zpool without specifying ashift setting, that the value is "dynamic" and either 9 or 12, based on what the drives report as it's physical block size? Or does it default to always 9?

Or do we need to check block size manually for all new zpool member drives first (#smartctl -a /dev/<device1> or #blockdev --getss --getpbsz /dev/<device1>). And then manually specify ashift during creation (#zpool create -f -o ashift=12 rpool mirror <device1> <device2>).

My second question is about ZFS compression. When I use command #zfs set compression=lz4 rpool, Does ZFS compression enabled have any effect (either speed up or slow down) read/write speeds on a VM with virtual disk fully encrypted with either LUKS or BitLocker? Or because the VM disk is encrypted, compression has no effect at all? Is the general "best practice" to always enable compression for ZFS pool?

My primary aim for both questions is speed.

thanks in advance, :)
 
Hi,

1. I recomand to see what smartctl show if you will use hdd/rotational disks. If you will use ssd, use ashift 12. Also you can try to create in a linux environment / non proxmox a pool with your disks without specify the ashift - zfs has its own code for detecting the ashift (if I remember correctly)
2. zfs compression on a encrypted virtual disk is only a waste of cpu, because any encrypt data are mostly uncompressed. And for the same reason you can setup the zfs cache to be only for metadata. So is more useful to use the memory for the VM and not for zfs data cache.

Maybe we have luck to see the zfs encryption support in zfs in the near future.


Good luck.
 
  • Like
Reactions: GadgetPig

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!