[zfs-discuss] ZFS zvols for KVM virtual machines storage

Gordan Bobic gordan.bobic at gmail.com
Thu Dec 28 17:23:06 EST 2017


On 28 Dec 2017 21:38, "Gionatan Danti" <g.danti at assyoma.it> wrote:

Il 28-12-2017 18:50 Gordan Bobic ha scritto:

>
> None of which helps you keep things aligned and minimize write
> amplification unless you can tell your FS on top of the zvol about it
> (for ext*, see -E stripe-width options).
>

XFS automatically recognize the better layout (mostly). But you have a
point, top-to-bottom alignement is hard to achieve.


I'm quite certain mkfs.xfs has no way of magically inferring what the
underlying zvol's volbvlocksize is.



L2ARC gets filled with evicted pages from ARC, so when
> primarycache=metadata, L2ARC cannot ever get anything but metadata in
> it.
>

Ops, you are right. So my plan B is not going to be very useful :)
Thank you for pointing that.


IMO, you should always set primarycache=metadata for the zvol or fs
> backing the VM images, and let the VM itself do it's own caching. It
> will be much faster and more efficient because the host OS cache is
> several context switches further away than the page cache inside the
> VM.
>

It depends on the specific guest requirements: to achieve good hit ratio
using guest's own cache, you need to assign it a good chunk of memory,
effectively overcommitting it. An host-side cache can be successfully
exploited by assigning *less* memory to the guest and mantaining good
performance.


Except if you are caching on the host, everything in the guest's cache is
inevitably also going to be in host cache as well, so you are wasting at
least the amount of RAM in the guest used for the cache. IMO you are far
better off sizing your guest RAM sensibly in the first place and having it
do all of it's own caching. It's going to work out far better I'm terms of
performance and efficiency.


In my virtual environment I found that to be the preferred approach, but
surely each workloads needs different considerations.


It's only a good way to make more things running even more slowly. Just
because the machine is virtual doesn't mean you can magically Gert away
with using less RAM for it's workload.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.zfsonlinux.org/pipermail/zfs-discuss/attachments/20171228/98b6f149/attachment.html>


More information about the zfs-discuss mailing list