Parameters
About ZFS recordsize ZFS tuning cheat sheet
ashift
recommended = 12
- vdev-scoped
- Immutable
- Physical (on-disk) sector size
- ZFS stores data in records
- Composed of sectors
- ZFS stores data in records
- Set in bits
ashift=9
= 512B sectorsashift=12
= 4K sectorsashift=13
= 8K sectors- Some newer SSDs
- If you get it wrong, overshoot - don’t undershoot
recordsize
- dataset-scoped
- Mutable
- Defaults to 128K (as of 2019)
- Pretty reasonable
- Want to map close to workload size in dataset
- JPGs ~5MB
recordsize=1M
- Prevents undue fragmentation
- Fewer IOPS
- MySQL InnoDB
recordsize=16K
- (InnoDB defaults to 16KB page size)
- MySQL InnoDB in a VM
- KVM .qcow2 files default to a
cluster_size
of 64KB recordsize=64K
- KVM .qcow2 files default to a
- JPGs ~5MB
- Too High
- Increased latency
- Too Low
- Greater fragmentation
- Performance issues down the road
- Limit compression ability
- ZFS compression is by record
compression=lz4
,ashift=12
, andrecordsize=4K
- No compression
- Sector size is equal to record size
- Can’t store data in half a sector
- Default
recordsize=128K
- Could easily do 1.7:1
- No compression
- Greater fragmentation
- Torrenting
- Torrenting access is small chunks with random access
- Suggests smaller record size
- Actual access is as larger files
- Suggests
recordsize=1M
- Suggests
- Torrenting access is small chunks with random access
xattr
xattr=sa
- Sets Linux Extended Attributes directly in inodes instead of as files in hidden folders
- Performance improvement on datasets with lots of files
- Especially with SELinux
- Little effect on datasets with few large files
compression
compression=lz4
atime
atime=off
- Don’t set access time
- Can double IOPS load
- Who cares