Snapshot listing speedup.
Pawel Jakub Dawidek
pjd at FreeBSD.org
Sun Jan 22 11:24:40 UTC 2012
If you have many snapshots and you were complaining that listing them
takes a lot of time, you may find the commit below useful.
It only works if your listing is limited to snapshot names and you want
to sort also by snapshot name (by default snapshots are sorted by
creation time).
On Sat, Jan 21, 2012 at 09:12:53PM +0000, Pawel Jakub Dawidek wrote:
> Author: pjd
> Date: Sat Jan 21 21:12:53 2012
> New Revision: 230438
> URL: http://svn.freebsd.org/changeset/base/230438
>
> Log:
> Dramatically optimize listing snapshots when user requests only snapshot
> names and wants to sort them by name, ie. when executes:
>
> # 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
--
Pawel Jakub Dawidek http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20120122/b1088e40/attachment.pgp
More information about the freebsd-current
mailing list