Having super high scrub times?

root@gibson:/home/daniel# df -h
Filesystem      Size  Used Avail Use% Mounted on
....
tank0/fish0     7.7T  3.3T  4.4T  43% /mnt/tank0/fish0

Over the past two years i noticed my weekly scrub time slowly increasing unproportional to how much i was filling the disk.

 root@gibson:/home/daniel# zpool status
  pool: tank0
  state: ONLINE
  scan: scrub repaired 0 in 19h20m with 0 errors on Mon Nov 23 19:24:32 2015
config:

        NAME        STATE     READ WRITE CKSUM
        tank0       ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            sda     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
            sdb     ONLINE       0     0     0

In my case this was due to torrenting directly to the ZFS pool, this tends to cause a bunch of random writes which heavily fragments the filesystem, so a scrub sends the disk heads jumping around trying to grab all that sparsely laid out data in a linear fashion.

Unfortunately there is no defragmentation utility at the moment but i had enough room that i could rsync -a everything over into an identical directory and delete the original, the end result:

root@gibson:/home/daniel# zpool status
  pool: tank0
  state: ONLINE
  scan: scrub repaired 0 in 6h24m with 0 errors on Mon Nov 30 11:24:21 2015
config:

        NAME        STATE     READ WRITE CKSUM
        tank0       ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            sda     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
            sdb     ONLINE       0     0     0

Some torrent clients provide the ability to preallocate the space needed or copy a completed torrents data to a new location, both of these features should also help with this issue.

Back