3 ms·
With appropriate cooperation between host and guest, you could use memory balooning [1] for this. Basically the guest is told the system memory is huge, but all
by toast0 6y ago
With appropriate cooperation between host and guest, you could use memory balooning [1] for this. Basically the guest is told the system memory is huge, but allocates most of it to a baloon driver that just gives it back to the host. You could signal the host to give it back to the guest when needed / paid for.
Complications: a lot of oses and some programs will tune themselves on startup to the size of the ram, if the baloon is large, you would have a lot of ram used in bigger kernel structures that might be never used. There's probably a practical limit on how much your memory could grow. Provisioning would be complex, as you mentioned.
Google cloud is documented to do live migration away from hosts that need maintenance, so it seems possible to at least potentially move guests if they want more ram and can't get it on the current system. You could also make expandable guests colocate with preemptable guests, and preempt guests when expansion was needed. Presumably, you could also make a tier with premptable ram, but that seems pretty specialized, I'm not sure if you would get enough users to meet provisioning needs.
Some physical systems have hotplug ram, but it's not very common. The expense doesn't seem worth the gains in most cases.
[1] https://en.m.wikipedia.org/wiki/Memory_ballooning https://en.m.wikipedia.org/wiki/Memory_ballooning
- rhn_mk1 6y agoGiven that hotplug exists, couldn't it be used to communicate the amount of available RAM to the guest instead of ballooning? That would leave the OS responsible for swapping hungry programs out and resizing kernel structures. I guess the missing piece is that it doesn't leave a good way for the guest to request more RAM (maxing out the balloon?).
- sscarduzio 6y agowhat if the guest's way to ask more ram is a super simple API call coming from a simple autoscaling system based on basic CPU/RAM usage metrics?