[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



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

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]