nexos wrote:
Quote:
But main memory for virtual machines? It makes no sense to overcommit that.
What do you mean? It could be very useful if someone wants to run a virtual machine with 2GB of RAM on a 4GB system with 2GB swap, while the server itself may even have to run multiple virtual machines. Then, because the VMs will likely have uneven memory usage patterns and not use most memory at once, they can all run happily.
Of course, that example is kind of lame; it would more likely be useful on big datacenter servers running hundreds of VMs on 128GB of memory.
On the contrary, your datacenter example is precisely an example of what I would not recommend.
Most OSes, tend to maximise RAM usage, as RAM is an expensive resource that is wasted if it's not used. Hence, file caches expand to use remaining unused memory. If that file cache is instead overcommitted on the underlying hypervisor machine, the memory the guest OS thinks is being put to good use caching file data is instead simply being cached (and copied) at two levels. Very sub-optimal.
If you have a 128GB RAM host memory, you're best off running the VMs with less memory and not overcommitting, and leaving it to the guest OSes to utilise that memory as they see fit.