PixelPrint Posted January 12, 2016 Share Posted January 12, 2016 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? Quote Link to comment
billington.mark Posted January 12, 2016 Share Posted January 12, 2016 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 Quote Link to comment
boof Posted January 12, 2016 Share Posted January 12, 2016 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. Quote Link to comment
PixelPrint Posted January 12, 2016 Author Share Posted January 12, 2016 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 Quote Link to comment
billington.mark Posted January 12, 2016 Share Posted January 12, 2016 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. Quote Link to comment
PixelPrint Posted January 12, 2016 Author Share Posted January 12, 2016 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 Quote Link to comment
boof Posted January 12, 2016 Share Posted January 12, 2016 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.