Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Mar 2019 08:52:36 +0700
From:      Victor Sudakov <vas@mpeks.tomsk.su>
To:        freebsd-virtualization@freebsd.org
Subject:   Re: bhyve and vfs.zfs.arc_max, and zfs tuning for a hypervisor
Message-ID:  <20190320015236.GA35511@admin.sibptus.ru>
In-Reply-To: <AA997A20-4EBF-46DF-A517-FD2072682545@punkt.de>
References:  <20190319024638.GA8193@admin.sibptus.ru> <AA997A20-4EBF-46DF-A517-FD2072682545@punkt.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--YZ5djTAD1cGYuMQK
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Patrick M. Hausen wrote:
>=20
> > 1. Does ARC actually cache zfs volumes (not files/datasets)?
>=20
> Yes it does.
>=20
> > 2. If ARC does cache volumes, does this cache make sense on a hyperviso=
r,
> > because guest OSes will probably have their own disk cache anyway.
>=20
> IMHO not much, because the guest OS is relying on the fact that when
> it writes it=E2=80=99s own cached data out to =E2=80=9Edisk=E2=80=9C, it =
will be committed to
> stable storage.

This is an important point.

> > 3. Would it make sense to limit vfs.zfs.arc_max to 1/8 or even less of
> > total RAM, so that most RAM is available to guest machines?
>=20
> Yes if you build your own solution on plain FreeBSD. No if you are running
> FreeNAS which already tries to autotune the ARC size according to the
> memory committed to VMs.
>=20
> > 4. What other zfs tuning measures can you suggest for a bhyve
> > hypervisor?
>=20
> e.g.
> 	zfs set sync=3Dalways zfs/vm
>=20
> if zfs/vm is the dataset under which you create the ZVOLs for your emulat=
ed
> disks.

Well, bhyve already has an option for this:

The block-device-options are:

nocache   Open the file with O_DIRECT.
direct    Open the file using O_SYNC.
ro        Force the file to be opened read-only.

I think something like=20
"-s 4:0,virtio-blk,/dev/zvol/zroot/vm/mail/disk0,direct"
would do the same?

>=20
> I=E2=80=99m using this for all my VM =E2=80=9Edisks=E2=80=9C and have add=
ed a 16 GB SLOG device
> to my spinning disk pool - seems to work great. This is on a home system.

Is SLOG also used by zfs volumes?

--=20
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/

--YZ5djTAD1cGYuMQK
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEbBAEBAgAGBQJckZzkAAoJEA2k8lmbXsY0uukH+JC3YmtDNjPduavG8UcnK1Dy
nMPQwavDdOyKK8v37n1K11ftUbdEOaHC+IWrrszuUxc3Ui/hPG6K3FAaLtLtwllp
6p+64AJ9w9t/nIoMfIGJfmU1BMQuE0JeXcJCaohoDXvyMfCxXApdxlK3iRRYa97T
8ch7Bc+f77cYuwvJkj0eW2pSmANObTsj5kcCLDhnWX9EuBoDpE1rmhfB1R1zxJaa
5PYpNChx8tqyb+O/Usex6pnZ9B7pKzO4lf4mDB13yg6ysWYnCGhECi54yZbE146h
OMaJsLpE1DxOe3aOCGsx19o5Fi+/mXb4qm1nwWTE5Jv+/zvtlVxjla+UySB0Dg==
=dqCO
-----END PGP SIGNATURE-----

--YZ5djTAD1cGYuMQK--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190320015236.GA35511>