Lessen Scrub Impact on ZFS Storage

vix9

Member
Feb 17, 2022
29
5
8
44
On one of my 4 nodes (all with identical hardware specs), the early stages of the monthly ZFS scrub push the IO_Delay on the host to very, very high levels causing some issues with the VMs on that host. In the past on my FreeNAS boxes, I used the tunable vfs.zfs.scrub_delay to lessen the scrub impact while it was running. I just would like to make sure I'm going about making this change in the right way to see if it has a positive effect. I could need to edit/create /etc/modprobe.d/zfs.conf and add the following line::

options zfs zfs_scrub_delay=8 (or whatever number works best, this worked best for me on FreeNAS)

Then run modprobe zfs.

What am I going to break by doing this? :)
 
Good morning,
I am not sure what you might break, but the possible configuration settings are these: ~# modinfo zfs. "zfs_scrub_delay" is not listed there...

Best regards
 
Its in the ZFS documentation so it should also work on linux: https://openzfs.github.io/openzfs-docs/Performance and Tuning/Module Parameters.html#zfs-scrub-delay

zfs_scrub_delay

zfs_scrub_delay sets a time-based delay for scrub I/Os. This delay is in addition to the ZIO scheduler’s treatment of scrub workloads. See also zfs_scan_idle

zfs_scrub_delayNotes
Tagsscrub, ZIO_scheduler
When to changeincreasing can reduce impact of scrub workload on dynamic workloads
Data Typeint
Unitsclock ticks
Range0 to MAX_INT
Default4
ChangeDynamic
Versions Affectedv0.6.0

You set ZFS options by editing (you might needto crete it first) the file "/etc/modprobe.d/zfs.conf". There you could aad a line like options zfs zfs_scrub_delay=8. You definitely lso need to reboot after doing changes. Not sure if you dditionally need to do a update-initramfs -u.
 
Last edited:
Its in the ZFS dodumentation so it should also work on linux
Interesting. "modinfo" lists 290 parameters... but no "scrub_delay". Perhaps it was not integrated during compile time?

Code:
~# modinfo zfs | head -2; modinfo zfs | grep scrub_delay; modinfo zfs | grep ^parm | wc -l
filename:       /lib/modules/5.15.35-2-pve/zfs/zfs.ko
version:        2.1.4-pve1
290
 

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!