Date: Sun, 22 Jan 2012 12:23:22 +0100 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: freebsd-current@FreeBSD.org Subject: Snapshot listing speedup. Message-ID: <20120122112322.GF1723@garage.freebsd.pl> In-Reply-To: <201201212112.q0LLCrQn009840@svn.freebsd.org> References: <201201212112.q0LLCrQn009840@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--+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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120122112322.GF1723>