Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Sep 2020 13:52:34 -0400
From:      Allan Jude <allanjude@freebsd.org>
To:        freebsd-fs@freebsd.org
Subject:   Re: OpenZFS and L2ARC
Message-ID:  <4f30a8a5-b7fb-e4bb-a5e6-b59fa4ec10c2@freebsd.org>
In-Reply-To: <b8f63e55-4c7e-8be0-7c52-5d8e6cb333f4@freebsd.org>
References:  <b8f63e55-4c7e-8be0-7c52-5d8e6cb333f4@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--BHIyuXEo77xdHCnTHZ5IPrjW2EOEbP8XD
Content-Type: multipart/mixed; boundary="m4BJR1mD8qd0ajS7YJhMBnWcxgtMpCAfA";
 protected-headers="v1"
From: Allan Jude <allanjude@freebsd.org>
To: freebsd-fs@freebsd.org
Message-ID: <4f30a8a5-b7fb-e4bb-a5e6-b59fa4ec10c2@freebsd.org>
Subject: Re: OpenZFS and L2ARC
References: <b8f63e55-4c7e-8be0-7c52-5d8e6cb333f4@freebsd.org>
In-Reply-To: <b8f63e55-4c7e-8be0-7c52-5d8e6cb333f4@freebsd.org>

--m4BJR1mD8qd0ajS7YJhMBnWcxgtMpCAfA
Content-Type: text/plain; charset=windows-1252
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 2020-09-08 03:43, Stefan Esser wrote:
> OpenZFS seems to work quite well for me, in general, but I have
> questions regarding the L2ARC statistics.
>=20
> The system uses a 3 * 6 TB raidz1 (plus further ZFS volumes that
> are not relevant here, since without level 2 ARC) and an 1 TB M.2
> SSD with a 256 GB partition for the L2ARC (and most of it currently
> unused, else).
>=20
> The L2ARC seems to have filled to the limit of 256 GB, but after
> several reboots, sysctl reports a L2ARC size of nearly twice the
> allocated space:
>=20
> kstat.zfs.misc.arcstats.l2_size: 534620858880
>=20
> That is 497 GiB, and might be possible with a lz4 compression
> factor of 2 - if the value reported is not the space allocated,
> but the actual (uncompressed) data held by the L2ARC.
>=20
>=20
> The sysutils/zfs-stats port reports the following values for
> this system, BTW:
>=20
> -----------------------------------------------------------------------=
-
> ZFS Subsystem Report=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Tue S=
ep=A0 8 09:02:46 2020
> -----------------------------------------------------------------------=
-
>=20
> L2 ARC Summary: (HEALTHY)
> =A0=A0=A0=A0Passed Headroom:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0
> =A0=A0=A0=A0Tried Lock Failures:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0
> =A0=A0=A0=A0IO In Progress:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
 0
> =A0=A0=A0=A0Low Memory Aborts:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 7
> =A0=A0=A0=A0Free on Write:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
 123
> =A0=A0=A0=A0Writes While Full:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0
> =A0=A0=A0=A0R/W Clashes:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0=

> =A0=A0=A0=A0Bad Checksums:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
 0
> =A0=A0=A0=A0IO Errors:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0
> =A0=A0=A0=A0SPA Mismatch:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
0
>=20
> L2 ARC Size: (Adaptive)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 49=
7.91=A0=A0=A0 GiB
> =A0=A0=A0=A0Header Size:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0.11%=A0=A0=A0=
 558.83=A0=A0=A0 MiB
>=20
> L2 ARC Evicts:
> =A0=A0=A0=A0Lock Retries:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
6
> =A0=A0=A0=A0Upon Reading:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
0
>=20
> L2 ARC Breakdown:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 5.75=A0=A0=
=A0 m
> =A0=A0=A0=A0Hit Ratio:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 81.94%=A0=A0=A0=
 4.71=A0=A0=A0 m
> =A0=A0=A0=A0Miss Ratio:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 18.06%=A0=A0=A0=
 1.04=A0=A0=A0 m
> =A0=A0=A0=A0Feeds:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0 235.04=A0=A0=A0 k
>=20
> L2 ARC Buffer:
> =A0=A0=A0=A0Bytes Scanned:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
 0=A0=A0=A0 Bytes
> =A0=A0=A0=A0Buffer Iterations:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0
> =A0=A0=A0=A0List Iterations:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0
> =A0=A0=A0=A0NULL List Iterations:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 0
>=20
> L2 ARC Writes:
> =A0=A0=A0=A0Writes Sent:=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 100.00%=A0=A0=
=A0 22.67=A0=A0=A0 k
>=20
> -----------------------------------------------------------------------=
-
>=20
> With the FreeBSD ZFS (without persistent L2ARC) I never got more
> than 20% hit ratio on the L2ARC between reboots.
>=20
> Quite a number of sysctl variable names have changed, and the port
> needs to be adapted to the new names (therefore there are lots of 0
> values in the -L output).
>=20
> The following names used by zfs-stats do not exist in OpenZFS:
>=20
> kstat.zfs.misc.arcstats.recycle_miss
> kstat.zfs.misc.arcstats.l2_write_buffer_bytes_scanned
> kstat.zfs.misc.arcstats.l2_write_buffer_iter
> kstat.zfs.misc.arcstats.l2_write_buffer_list_iter
> kstat.zfs.misc.arcstats.l2_write_buffer_list_null_iter
> kstat.zfs.misc.arcstats.l2_write_full
> kstat.zfs.misc.arcstats.l2_write_in_l2
> kstat.zfs.misc.arcstats.l2_write_io_in_progress
> kstat.zfs.misc.arcstats.l2_write_not_cacheable
> kstat.zfs.misc.arcstats.l2_write_passed_headroom
> kstat.zfs.misc.arcstats.l2_write_pios
> kstat.zfs.misc.arcstats.l2_write_spa_mismatch
> kstat.zfs.misc.arcstats.l2_write_trylock_fail
> kstat.zfs.misc.arcstats.l2_writes_hdr_miss
> vfs.zfs.vdev.cache.size
>=20
> The existence of vfs.zfs.vdev.cache.size vs vfs.zfs.vdev.cache_size
> can be used to detect OpenZFS, and is easily fixed.
>=20
> But the above listed L2ARC values seem to have been removed from or
> have never existed in OpenZFS, and I did not find any substitutes.
>=20
> Are there any plans to re-create them in OpenZFS on FreeBSD or are
> they gone for good?
>=20
> I'd like to update the zfs-stats port for compatibil=EDty with OpenZFS =
=2E..
> _______________________________________________
> freebsd-fs@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"

I think the kstats you are looking for are:

kstat.zfs.misc.arcstats.l2_asize: 0
kstat.zfs.misc.arcstats.l2_size: 0

l2_asize is the 'allocated' size, that will be how much actual disk
space is used. And l2_size will be the amount of data contained, so
compression may make this quite a bit larger than the size of the
physical device.


--=20
Allan Jude


--m4BJR1mD8qd0ajS7YJhMBnWcxgtMpCAfA--

--BHIyuXEo77xdHCnTHZ5IPrjW2EOEbP8XD
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iQIcBAEBAgAGBQJfV8TjAAoJEBmVNT4SmAt+UsAQAMHOPL/VVqRg1UlNzlHWR5MB
aAALic6r+kRG1uI2sFHuLJFEW0KDNmSV0wS2yZGIoXdmEmGSGtk2vPZtdMGW8e4Y
BCNY36zCaC9HPc5R6nL+PFdV2U0CU46WEtCQy51ESotjQxNR+EkVnETuRLyaDTMY
vqAgs33ue/fVKSot8UfgYedjJlT8F1CtRGuby3cClZUr7HmBesJrstZoIv+0NJ8H
MQhGhOvuSeeLQz81LOVsC9nj1PcAtAHBJbbffAhC0wLh6rQC92OaFNUQFj+4BXpm
7w3JzAbUi/+MpY8xIFNkxuYAQ9ve3KBAy7EtHFWY/vCNZIkoM8XSuCPilFFXiNLE
paqZ2WCutckXpc5J3lYZIFWiEMgjuSUhut5IZaGd0CBa4AqGT2q1BPFxMndLehaP
b5Aq8cAKIKRxL3++6vQgO7KUVAF2QBcrkI6GSUd5stE7NKPqi+5panCkQwd5AGFP
NFSAfNIQrKQ3bl0pVq3oyPnxjTsnKvlpvRLXsJZhZC99jxx7qa+eXyUdr1HC9kLy
VnP5sd3Xk37lce5UnQKa+pLHkR5JrWmvPiHXT24+aQJxhZfI546qfdOFnztzs68Z
iJAYXAy7qINXRIscc0ytiaSabr77dlvgBAIkCu6VGrhAZMLQtgnh5nr6fXeND81W
IG3TavEXUNFKfXSByYwn
=YTk9
-----END PGP SIGNATURE-----

--BHIyuXEo77xdHCnTHZ5IPrjW2EOEbP8XD--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4f30a8a5-b7fb-e4bb-a5e6-b59fa4ec10c2>