[libvirt] [Question] Is it ok to occupy large amount of cache when save?

Eric Blake eblake at redhat.com
Wed Feb 19 04:22:21 UTC 2014


On 02/18/2014 09:06 PM, Wangyufei (James) wrote:
> Hello,
>     When I call virDomainManagedSave, libvirtd will fork a child process libvirt_iohelper to write save file, and the system cache will
> increase soon just like this: 
> 
> Swap:        0M total,        0M used,        0M free,     1668M cached
> Swap:        0M total,        0M used,        0M free,     1715M cached

Yep, that's what the kernel does if you don't use 'virsh managedsave
--bypass-cache'.

> 
>     But I have cgroup to control the memory of libvirtd below 50 M, so in this case, libvirt_iohelper will be killed, and virDomainManagedSave failed.
> 
>     So my question is: 
>     1. Is it ok for libvirtd to occupy large amount of cache when save? Can we flush cache in time?
>     2. In my situation, is it any good idea to help me out? Increase the memory limit value? Pass through the cache? Flush cache? Or any one better? Which one
>       do you preffer? 

Try using the --bypass-cache flag (VIR_DOMAIN_SAVE_BYPASS_CACHE), which
tells libvirt to use O_DIRECT which in turn avoids filling the kernel
file system cache (won't work on tmpfs, which is why it is not default).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140218/0d75c7b9/attachment-0001.sig>


More information about the libvir-list mailing list