[libvirt] [PATCH 0/2] Add 'l2-cache-size' property to specify maximum size of the L2 table cache for qcow2 image

Kashyap Chamarthy kchamart at redhat.com
Wed Nov 15 21:05:21 UTC 2017


On Wed, Nov 15, 2017 at 04:09:28PM +0100, Alberto Garcia wrote:
> On Wed 15 Nov 2017 12:21:24 PM CET, Kashyap Chamarthy wrote:
> > [Cc: Alberto Garcia of QEMU, who added the 'l2-cache-size' upstream]
> 
> [...]
> 
> >> There's already something on list about l2 cache, see
> >> 
> >> https://www.redhat.com/archives/libvir-list/2017-September/msg00553.html
> >> 
> >> it adds 3 related variables. IIRC, the "hold up" is how best to
> >> describe how to use it or provide the feature in such a way that it's
> >> "understandable" for general consumption without making a "policy"
> >> that generates certain values based on expected usage/needs for the
> >> client.
> >
> > I recall Alberto saying that there's a default value of QCOW2
> > 'l2-cache-size', but it is (intentionally?) low.  And that the value
> > depends on the workload / use case: size of the image, the amount of
> > I/O you want to do, etc.
> 
> I actually didn't add that parameter.

Err, sorry for the misattribution, I already wondered while writing
that line that I should've checked. I meant to mention your blog post:

    https://blogs.igalia.com/berto/2015/12/17/improving-disk-io-performance-in-qemu-2-5-with-the-qcow2-l2-cache/
 
> Looking at the history it seems that the default size hasn't changed
> since Fabrice Bellard added it back in 2006, so I assume that it was
> fine for most use cases back in the day and it was never discussed
> afterwards.
> 
> This was probably mentioned already, but here's what I've written about
> this topic:
> 
>    https://bugzilla.redhat.com/show_bug.cgi?id=1377735#c2
> 
>    https://www.redhat.com/archives/libvir-list/2017-October/msg00180.html
> 
> From the user's point of view the simplest use cases are perhaps:
> 
>    1) I want to use at most xxx MB for the qcow2 L2 cache.
>    2) I want to use as much cache as I need in order to get the best
>       performance.
> 
> Those should be relatively straightforward and easy to understand for
> the user, (1) is simply the value of l2-cache-size, and for (2) libvirt
> would have to make the calculations itself.
> 
> Some things to take into account:
> 
>    - l2-refcount-size is set to be 1/4 of l2-cache-size (see "How to
>      configure the cache sizes" in docs/qcow2-cache.txt in QEMU), but it
>      probably makes sense to keep it artificially low (it's not so
>      important for I/O perfomance, although I dont have numbers of its
>      actual impact).
>    - cache-clean-interval can also be useful, see the bugzilla link for
>      more details.

Thanks for the explanation and pointers.

-- 
/kashyap




More information about the libvir-list mailing list