# How to limit scrub bandwidth: vfs.zfs.scrub_limit



## t1066 (Apr 25, 2012)

When performing scrub on a zpool, network throughput may drop suddenly, programs may appear to hang, etc. According to the source,


```
/* maximum scrub/resilver I/O queue per leaf vdev */
int zfs_scrub_limit = 10;

TUNABLE_INT("vfs.zfs.scrub_limit", &zfs_scrub_limit);
SYSCTL_INT(_vfs_zfs, OID_AUTO, scrub_limit, CTLFLAG_RDTUN, &zfs_scrub_limit, 0,
    "Maximum scrub/resilver I/O queue");
```

So if you have not change vfs.zfs.vdev.max_pending, then setting vfs.zfs_scrub_limit to some value less than 10 in /boot/loader.conf will alleviate the above problem. I tested setting vfs.zfs_scrub_limit=8 and it worked beautifully.


----------

