zvol volblocksize doubts

H25E

Active Member
Nov 5, 2020
71
5
28
33
Hello everybody,

Right now I have a 4TB zvol that is attached to a VM that works as a fileserver over NFS/SAMBA. There are some issues with this zvol configuration (mainly related with volblocksize) and I would like to create a new one with the right config to replace the old one.

This zvol is over a zpool that is on a raidz-1 of 4 disks. The ashift of the disks is 12 (4kb) and the volblocksize is 8kb (the default one). With this config I'm using x1.5 times more space than with an ideal raidz-1. I have calculated that this parameter would be reduced to x1.13 with volblocksize = 16 or 32 and reduced to x1.03 with a volblocksize = 64 or 128. So, from this approach the best size would be 64 or 128k, but there are more things to take into account.
  • Compression: Right now compression is off, but I would like to set it on for the new drive. With the current volblocksize of 8kb (and a sector size of 4kb) I supose that compression will be bad. Which would be a good volblocksize/sectorsize for compression? Or it's simply get the bigges volblocksize avaiable?
  • It's necessary/good to align the block size of formatted filesystem with the volblocksize of the volume? Wouldn't compression break this align?
In conclusion, I would like to know which volblocksize set to the new zvol and with whick block size format it to get a good equilibrium between wasted space, performance and compression efficiency.

Again, thanks for your time.


Héctor
 
Hello Héctor,

if you have enough storage, you can change the volblocksize parameter in the storage configuration of the cluster and move the disk away and back. Than the volblocksize of the new zvol reflects the changed value.
As for the question for best values, i think you have to benchmark your concrete workload.
 
Thanks for your answer wigor,

But at least for the top filesystem block size. Does it makes sense to make it the same size as volblocksize when compression is enabled? If someone already knows would be cool to know it beforehand.