Hello, all! Thanks mercenary_sysadmin for setting this forum up! I’ll start off with one of the first technical questions
I recently switched my (Linux) root filesystem to zfs and I’ve been running into issues where I/O load causes audio/video playback to heavily stutter. It seems to happen mostly during writes, whether it’s a Steam game install sequentially writing a huge file or a build process + ccache writing tons of little object files.
I’m fairly certain the issue is with zfs or my configuration of it because it doesn’t seem to happen with btrfs (+zstd:3) or ext4. What I did for testing was:
blkdiscard
the entire disk- Format with EFI partition + single zfs, btrfs, or ext4 partition
- Load my Fedora 38 OS image
- Boot up the system
- Start up a Youtube video in Firefox
- Run
fio
(or anything else that causes I/O) - Audio/video starts stuttering with zfs, but not with btrfs or ext4
To make sure it’s not something hardware related, I tested the same steps (and same OS image) on all of my computers:
- Laptop: Intel i9-10885H + Toshiba KXG6AZNV1T02 NVME SSD
- Desktop: Intel i9-9900KS + Samsung 970 Pro NVME SSD (also tried with 980 Pro)
- Server: Intel i5-13600K + Lenovo PX04PMC NVME enterprise SSD
Without fail, the same thing happens on every system.
ZFS configuration:
- Fedora 38 +
kernel-6.3.8-200.fc38.x86_64
+zfs-2.1.12-1.fc38.x86_64
- pool
ashift=12
- dataset
recordsize=128K
(default, not explicitly set) - dataset
compression=lz4
- dataset
xattr=sa
- dataset
acltype=posix
- dataset
relatime=on
- dataset
encryption=aes-256-gcm
Has anyone else ran into this sort of issue? If so, did you manage to fix or work around it?
I came across ZFS kernel threads priority · openzfs/zfs · Discussion #14258 · GitHub, which seems to be relevant. It would make sense if the ZFS kernel threads are being set to the highest priority nice
value. I’m only using lz4
though, which shouldn’t be very CPU-intensive. The thread links to commit Align thread priority with Linux defaults · openzfs/zfs@1229323 · GitHub, which first introduced the thread priority. Maybe I’ll try modifying the source to change the priority. I’d happily trade some I/O performance for better CPU latency.