April 03, 2008

Memory overcommitting and virtualization

During March the virtualization scene, or at least the most technical part of it, discussed about memory management. What does it mean?

Imagine you are going out for a picnic with 10 friends. You could choose 3 cars or a small bus. You go for the bus so you can save a little on fuel, just like you could install 10 virtual machines on a single hardware server and save power. So far so good: but now, let's take the metaphor further: since you are going to have a picnic, you need some tools, like a barbecue, a blanket, a basket and so on. Once again, you could have one item for each person, or you could share it. In virtualization, this is called page sharing: virtual machines share memory pages with the same contents.

Page sharing is a (big) part of the memory overcommitting in virtual environment. The next part is the balloon driver. Image you have to take your coat off in your car: you take a little more space on the backseats and your friend tries to get out of the way, since he's not doing anything important. The same goes for the balloon logic: if a virtual machine is not actually using the RAM it was allowed to, it gets "preempted" and memory is assigned to another machine.

VMware, in an attempt to show how its own overcommitting is far better than the rest (say, for instance, XEN's) has shown us some tests where various instances of Windows are running various applications. Virtualization.info covered the story as well.

So, why am I writing about that? Well, as always with tests, we have to think about them, otherwise we just oversight their real meaning. Repeat with me: overcommitting has to be tested in my environment before I can judge it and do proper capacity planning.
Why? 178 virtual machines all running up-to-date Windows and (almost) the same services will leverage page sharing! And a lot of it, I shall add. So you cannot really do capacity planning considering memory overcommitting if you, like 90% of the companies I know (and that's a lot) run different operating systems,applications and so on.

We could wonder why VMware is not showing some tests with different OSes and services.. and by now you probably can answer yourself to this question.