Posted 26 January, 2017
Lets start out with saying that ZFS on Linux (ZoL) is pretty awesome, snapshots, compression-on-the-fly, quota’s, … I love it. However ZoL also has issue’s, I even blogged about some in the past. (a full ZFS pool, failing to load ZFS module) Most cases where my own fault, but still, its very uncommon for a file system to be such a pain in the ass.
The last few days, I tried to find out why, my installation was so slow. Slow in this context is hard to define. Sometimes users complained about slow ls runs, while write speed was decent enough … read speed was also fine, perhaps NFS was at fault, perhaps disks, controller, … ?
Long story short, I looked for some tuning options, as the defaults most likely aren’t perfect. Before I take all the credit, I was masterly helped by senior systems engineer, ewwhite in this matter. So lets go over some “simple” tune options during initial creation.
Bragging rights, right ? Sadly its for work… (or happy for my power bill)
Setting these value’s can be done on a live system, however most of them will only apply for new data or rewrites, so try to do them when creating a pool. Setting them to a pool is done :
# in case you want to apply to a specific subpool zfs set parameter=value pool/subpool # pool and all not locally set subpools, will receive this parameter zfs set parameter=value pool
Sub-pools inherit from the pool above them, so setting these features will auto-magically inherit from the top level setting when you create sub-pools. (Eg. tank/users will inherit from tank unless defined otherwise)
zfs set xattr=sa tank/users zfs send tank/users > tank/users_disk.img zfs destroy tank/users zfs receive tank/users < tank/users_disk.img
[[email protected] jbod1]# zfs get all huginn| grep compres huginn compressratio 1.36x - huginn compression lz4 local
That’s 36 TB of extra space… note : allot of data is already compressed more heavy using gzip. This is a must have. Not only does it help you get more storage, writing uncompressed data is most likely taking longer then writing compressed data.
And that’s it, next time lets look at the kernel module 🙂