January 12, 201610 yr KVM allows to a VM to increase its RAM on the fly, so I could make a VM with 4GB RAM that could go up to 8GB. The question is, is this ballooning smart enough to force VMs to decrease their RAM usage and give it back if I run other virtual machines?
January 12, 201610 yr Yes, it does. Works alot better on linux guests rather than windows though as its built into the linux kernel. Advice at the moment seems to be to disable balooning (set min\max memory as the sane value) on Windows. if its something that interests you, id advise to keep an eye on the virtio windows drivers changelog to see if any improvements are implemented: https://fedorapeople.org/groups/virt/virtio-win/CHANGELOG
January 12, 201610 yr Ballooning isn't a magic bullet. It can only reap memory the guest OS has allocated but isn't actually using (cache etc etc) and / or apply other clever tricks (dedupe of memory across guests etc) to try and free some real memory. If all your vm's are, genuinely, actively paging all memory in the guests - the hypervisor won't be able to do much about it. You're rolling the dice if you force the hypervisor into a position where it needs to start thinking about this. I'm not sure on kvm's default behaviour if guests exhaust memory - vmware will start swapfiling so killing performance but at least keeping the guests up. My understanding anyway.
January 12, 201610 yr Author What I'm seeing is that if I run another VM, KVM prefers to kill all the VMs rather to wait for free memory (balloon service is installed in the test Windows VMs), and this is unacceptable
January 12, 201610 yr if thats the case, surely adding more memory is the fix? or assigning less memory to existing VMs? if you are looking to squeeze every last MB out of memory, you'd be better using a dedicated hypervisor rather than an OS that needs to use memory for its own stuff as well.
January 12, 201610 yr Author No, I was just doing overprovisioning tests. In the future it would be nice to run some rarely used VM and don't have to "waste" 1GB ram just for that
January 12, 201610 yr General rule of thumb is don't over provision memory for guests. As above ballooning is a last resort but isn't magic and can't always fix the issue. You could investigate KVM being able to use disk as swap for guest memory / migrate to vmware which does do swapping and accept the performance penalties when ballooning fails and the hypervisor swaps your guest memory out. My hunch would be KVM *does* try to swap out guest memory (rather than, as you're seeing killing the guest or more accurately having the KVM process oom'd ?) but uses the system swap space to do so. And I don't think unraid runs with swap? I can't check my unraid machine right now to confirm. If that's the case you could configure unraid with some swap space and see if that will allow KVM to swap guest memory. Performance penalties but your vms would keep running.
Archived
This topic is now archived and is closed to further replies.