HomeFreeBSD

Speed up 'zfs list -t snapshot -o name -s name'

Description

Speed up 'zfs list -t snapshot -o name -s name'

FreeBSD #xxx: Dramatically optimize listing snapshots when user
requests only snapshot names and wants to sort them by name, ie.
when executes:

  1. zfs list -t snapshot -o name -s name

Because only name is needed we don't have to read all snapshot
properties.

Below you can find how long does it take to list 34509 snapshots
from a single disk pool before and after this change with cold and
warm cache:

before:

    # time zfs list -t snapshot -o name -s name > /dev/null
    cold cache: 525s
    warm cache: 218s

after:

    # time zfs list -t snapshot -o name -s name > /dev/null
    cold cache: 1.7s
    warm cache: 1.1s
NOTE: This patch only appears in FreeBSD. If/when Illumos picks up the change we may want to drop this patch and adopt their version. However, for now this addresses a real issue.

Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #450

Details

Provenance
pjdAuthored on May 29 2012, 5:50 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jun 14 2012, 4:49 PM
Parents
rG74497b7ab6af: Add zvol_inhibit_dev module option.
Branches
Unknown
Tags
Unknown