Re: To save or not to save



On Thu, Nov 15, 2012 at 9:31 PM, Daniel P. Berrange <berrange redhat com> wrote:
> On Thu, Nov 15, 2012 at 07:49:46PM +0200, Zeeshan Ali (Khattak) wrote:
>> Hi everyone,
>>    As you all know currently we save running local VMs when user quits
>> Boxes UI. The reason for doing so were:
>>
>> 1.  We want to reclaim all the resources (especially RAM, cause CPU
>> could be saved by only pausing the VM)
>> 2. VM state should not be lost across reboots/shutdowns of host
>>
>> However, saving of VM seems to have been a very heavy operation,
>> especially on machines with not a lot of RAM (on my machine with only
>> 4GB RAM, host more or less freezes completely for a few seconds). The
>> reason AFAICT is that most of guest RAM being unused is swapped out so
>> saving then involves copying GBs of data per running VM from one part
>> of the drive to another.
>
> Have you tried making Boxes use the
>
>   VIR_DOMAIN_SAVE_BYPASS_CACHE
>
> flag yet ? oVirt saw serious problems with host performance when
> saving VMs to disk, unless they used VIR_DOMAIN_SAVE_BYPASS_CACHE
> to avoid trashing the I/O cache.

Not yet. I somehow forgot about that actually. :( Now added to top of
my todo file so will do so soon enough. :)

>> So I've been wondering if its worth it to save the VMs on quit. So
>> lets look at both the reasons above:
>>
>> 1. For hosts with a lot of RAM, where most of the guest RAM will not
>> be swapped out, is there a compelling reason to save RAM as they have
>> plenty to spare? For hosts with not a lot of RAM, saving mostly just
>> means saving swap at the cost of home partition (or somewhere else in
>> filesystem).
>>
>> 2. Alex already fixed that on libvirt level I believe?
>
> Fixed what in libvirt ?

Saving of VMs on logout, reboot and shutdown. Or did I i misunderstand
the purpose of his work?

>> So I'm not sure if saving all running VMs at quit is a great idea
>> anymore. One thing we could do is to compare the memory usage of all
>> the guests with memory size of host and make the decision to save or
>> not to save based on that.
>
> I'd like to see more concrete data & research on what we can do to
> improve save-to-disk before abandoning it.

Sure thing! As I said in my first mail, I'm just thinking aloud and
asking for ideas on how to best solve the issues.

-- 
Regards,

Zeeshan Ali (Khattak)
FSF member#5124


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