Project

General

Profile

Feature #6902

speed up listing of snapshots if requesting name only and sorting by name

Added by Martin Matuška over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2016-04-11
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

pjd has authored and commited a patch in Jan 21, 2012 that substanially speeds up zfs snapshot listing if requesting only the name property and sorting by name.
In this special case, the snapshot properties do not need to be loaded. This code has been adopted by zfsonlinux on May 29, 2012.

Commit message from pjd:

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:

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

after:

  1. time zfs list -t snapshot -o name -s name > /dev/null
    cold cache: 1.7s
    warm cache: 1.1s

References:
http://svnweb.freebsd.org/base?view=revision&revision=230438
https://github.com/freebsd/freebsd/commit/8e3e9863
https://github.com/zfsonlinux/zfs/commit/0cee2406


Related issues

Related to illumos gate - Bug #6980: 6902 causes zfs send to break due to 32-bit/64-bit struct mismatchClosed2016-05-17

Actions

History

#1

Updated by Electric Monk over 3 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 0d8fa8f8eba3ea46bc79d73445009505d1dd5d7d

commit  0d8fa8f8eba3ea46bc79d73445009505d1dd5d7d
Author: Martin Matuska <martin@matuska.org>
Date:   2016-05-15T14:00:09.000Z

    6902 speed up listing of snapshots if requesting name only and sorting by name
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Pawel Dawidek <pjd@freebsd.org>
    Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
    Approved by: Garrett D'Amore <garrett@damore.org>

#2

Updated by Gernot Strasser over 3 years ago

  • Related to Bug #6980: 6902 causes zfs send to break due to 32-bit/64-bit struct mismatch added

Also available in: Atom PDF