[zfs-discuss] Sequential scrubs and resilvers have been added to ZoL

Chris Siebenmann cks at cs.toronto.edu
Fri Nov 17 13:12:54 EST 2017


 Very recently, a piece of great news landed in the ZFS on Linux master
repository:

    commit d4a72f23863382bdf6d0ae33196f5b5decbc48fd
    Author: Tom Caputi <tcaputi at datto.com>
    Date:   Wed Nov 15 20:27:01 2017 -0500
	
    Sequential scrub and resilvers
    
    Currently, scrubs and resilvers can take an extremely
    long time to complete. This is largely due to the fact
    that zfs scans process pools in logical order, as
    determined by each block's bookmark. This makes sense
    from a simplicity perspective, but blocks in zfs are
    often scattered randomly across disks, particularly
    due to zfs's copy-on-write mechanisms.
    
    This patch improves performance by splitting scrubs
    and resilvers into a metadata scanning phase and an IO
    issuing phase. The metadata scan reads through the
    structure of the pool and gathers an in-memory queue
    of I/Os, sorted by size and offset on disk. The issuing
    phase will then issue the scrub I/Os as sequentially as
    possible, greatly improving performance.

    [...]

I updated the workstation I have with HD-based ZoL pools this morning
and did some test scrubs. The results on my oldest pool (with a lot of
small and scattered files) are very nice. 'zpool list' reports 293 GB
allocated, and last weekend it scrubbed in 02:25:40. This morning it
scrubbed in just under half that time, in 01:10:54.

 Oracle implemented their own version of sequential scrubs and resilvers
a few years ago in Solaris ZFS, and it's been one of the few features
that I really envied from their closed source version of ZFS. Now ZFS
on Linux has a version of it (and likely soon all OpenZFS versions), and
we'll get the benefits of faster scrubs and especially faster resilvers.

(Scrubs and resilvers on SSD based pools may speed up as well, but
probably nowhere near as much because they're much less seek limited.)

	- cks


More information about the zfs-discuss mailing list