OpenVZ redefines RAM

My new hosting location is an OpenVZ VPS at Quantact. This is working out pretty well, except for one thing – Ram usage.

One of the things a VPS provides as part of the package is Ram. The usual definition of Ram is real memory, the sticks of chips you buy to put into a machine. OpenVZ defines Ram as something different. To OpenVZ, Ram is actually virtual memory.

This is a big deal, as a bunch of the things I want to run use very little real memory, but do take up a bunch of virtual memory. Here’s some examples:

MySQL (using a small configuration!):
- Resident memory for my application: 10MB
- Virtual memory applied to my account: 80MB

Monit:
- Resident memory: 2MB
- Virtual memory: 45MB

These two applications put me at 130MB of Ram used before I start writing code. Since I’m writing Rails code, I need all the memory I can get. Two Mongrel processes running Typo can easily be 60MB each, putting us at 250MB for my blog!

There are all sorts of posts around the web about this issue, and the OpenVZ guys try to defend what they are doing, but the big problem is that they are using the wrong terminology for memory, and this will eventually make people grumpy. If you’re measuring virtual memory, tell people that the limits are for virtual memory, not ‘Ram’.

I think they do this to help make VPS hosting costs very competetive with Xen based systems. You only find out later that you actually need to buy twice as much memory as you thought you needed.

How about setting up some swap space, I hear you ask. Well, OpenVZ doesn’t allow swap space in the guest OS space. Swap is managed globally, so you have no control over this. This is an artifact of the virtualization technology used by OpenVZ. Xen does allow swap space, so doesn’t need as much Ram as an equivalent OpenVZ configuration.

The takeaway here is that, if you are looking at an OpenVZ VPS host, you should budget for more Ram than you think you need, as you will probably need it.

Tim of Quantact has put up a wiki page explaining a little about the OpenVZ Ram usage

Note: I believe Virtuozzo is the same basic code as OpenVZ, so the same issue applies.

This entry was posted on Tue, 26 Dec 2006 02:17:59 GMT . You can follow any any response to this entry through the Atom feed. You can leave a comment .
Tags


Comments

Leave a response

  1. Tomislav 3 days later:

    I’ve tried Quantact’s OpenVZ VPS too and had the same problems.

    Now I’m using Xen at www.slicehost.com and it is so much better. And only 20$/month for 256mb of RAM.

  2. hazard 27 days later:

    I encountered the same problem with MySQL in OpenVZ. After I turned off InnoDB support mysqld footprint as seen by OpenVZ has decreased by about 100 MB, making it possible to work in a 128 MB OpenVZ host. I posted an article about it in my blog over here.

Leave a comment