From owner-freebsd-current@FreeBSD.ORG Sun Jan 22 11:24:40 2012 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07ACF106567B for ; Sun, 22 Jan 2012 11:24:40 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id B17CF8FC21 for ; Sun, 22 Jan 2012 11:24:39 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 65AECE0E for ; Sun, 22 Jan 2012 12:24:36 +0100 (CET) Date: Sun, 22 Jan 2012 12:23:22 +0100 From: Pawel Jakub Dawidek To: freebsd-current@FreeBSD.org Message-ID: <20120122112322.GF1723@garage.freebsd.pl> References: <201201212112.q0LLCrQn009840@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+ts6NCQ4mrNQIV8p" Content-Disposition: inline In-Reply-To: <201201212112.q0LLCrQn009840@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Snapshot listing speedup. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 11:24:40 -0000 --+ts6NCQ4mrNQIV8p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 >=20 > Log: > Dramatically optimize listing snapshots when user requests only snapshot > names and wants to sort them by name, ie. when executes: > =20 > # zfs list -t snapshot -o name -s name > =20 > Because only name is needed we don't have to read all snapshot properti= es. > =20 > 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: > =20 > before: > =20 > # time zfs list -t snapshot -o name -s name > /dev/null > cold cache: 525s > warm cache: 218s > =20 > after: > =20 > # time zfs list -t snapshot -o name -s name > /dev/null > cold cache: 1.7s > warm cache: 1.1s --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --+ts6NCQ4mrNQIV8p Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8b8aoACgkQForvXbEpPzStzACgpBTvvkyoSEDSX8w8LFWI9ve9 JlkAnA8wZ5IpfAFIEJyROXhRS7+pe3nK =HEIJ -----END PGP SIGNATURE----- --+ts6NCQ4mrNQIV8p--