So I am running a bunch of guests on a bunch of servers and currently my "standard" guest partitioning goes like this:
- 1GB for /boot
- 4 - 8 GB for swap
- the rest for /
I allocate various amounts of RAM to each guest, depending on the needs of the app running within it. Swap too depends on the app.
The swap is there for the times when some operation goes beyond what it was designed for and uses more RAM that there is.
However,this seems quite wasteful to me: I'm using 4 - 8GB of disk space for each guest just because it might need it a couple of times per day? Considering that those guests are typically 20GB, hosting code mostly (database servers are separate), that's quite a percentage.
I just spent reading the posts about this on various stack exchange sites, but haven't found any trace of a more elegant solution. By "elegant solution" I mean some sort of swap space sharing among clients.
The suggested approaches (that I saw) are:
- use swap in guest
- overcommit the host
Alternatively, the best approach that already works (but wasn't suggested all that often) seems to be memory ballooning (only works on Linux guests, but that's fine) with some sort of real-time monitor / adjustment agent that would allocate RAM on demand.
So, what is the best approach to take these times?