TOP

vSWAP Replaces User Beancounters

Since the release of CentOS 6, OpenVZ has modified the memory management model, replacing User Beancounters. This new method is called vSWAP and is what we will be offering to all new customers as a new standard.

It eliminates a lot of confusion between Guaranteed/Burstable memory models in the old system, and allows your VPS to behave in a more predictable way (more like a dedicated server).

Most of our customers have been migrated to the newer CentOS 6 nodes and vSWAP has already been implemented. If you have been migrated, the guaranteed RAM is what you will now see in your SolusVM interface and the burstable RAM will now show as SWAP within your VPS.

You can view how much SWAP you have allocated by typing the command:

# free -m

This is the official description for vSWAP provided by the OpenVZ Wiki:

New RHEL6-based OpenVZ kernel has a new memory management model, which supersedes User beancounters. It is called VSwap.

Now you can set two primary parameters: physpages and swappages, while all the other beancounters become secondary and optional.

  • physpages
This parameter limits the physical memory (RAM) available to processes inside a container.
The barrier is ignored and should be set to 0, and the limit sets the limit.
Currently (as of >= 042stab042) the user memory, the kernel memory and the page cache are accounted into physpages.
  • swappages
This parameter limits the amount of swap space which can be used for processes inside a container.
The barrier is ignored and should be set to 0, and the limit sets the limit.

The sum of physpages.limit and swappages.limit limits the maximum amount of allocated memory which can be used by a container. When physpages limit is reached, memory pages belonging to the container are pushed out to so called virtual swap (vswap). The difference between normal swap and vswap is that with vswap no actual disk I/O usually occurs. Instead, a container is artificially slowed down, to emulate the effect of the real swapping. Actual swap out occurs only if there is a global memory shortage on the system.

As always, if you have any questions regarding this post, please contact us or post a comment below.

Leave a Reply

Your email is never published nor shared.

You may use these HTML tags and attributes:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>