Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

VSwap

645 bytes added, 20:44, 1 October 2013
Add Implicit UBC parameters
'''New [[Download/kernel/rhel6|RHEL6-based OpenVZ]] kernel''' has a new memory management model, which supersedes [[UBC|User beancounters]]. It is called '''VSwap'''.
Now you can set With VSwap, there are two primary required parameters: <code>ram</code> and <code>swap</code> (a.k.a. <code>physpages</code> and <code>swappages</code>), while all . All the other beancounters become secondary and optional.
* '''physpages'''
{{Note|swap used by a container can exceed <code>swappages.limit</code>, but is always within sum of <code>physpages.limit</code> and <code>swappages.limit</code>.}}
 
=== Implicit UBC parameters ===
 
Since vzctl 4.6, if some optional beancounters are not set, vzctl sets them implicitly,
using ram and swap and, in case of privvmpages, a new parameter called '''VM overcommit'''.
 
The following formulae are used:
 
<math>lockedpages_{bar} = oomguarpages_{bar} = ram</math>
 
<math>lockedpages_{lim} = oomguarpages_{lim} = \infty</math>
 
<math>vmguarpages_{bar} = vmguarpages_{lim} = ram + swap</math>
 
Also, if <math>vm\_overcommit</math> is set to non-zero:
 
: <math>privvmpages_{bar} = privvmpages_{lim} = (ram + swap) \times vm\_overcommit</math>
 
otherwise:
 
: <math>privvmpages_{bar} = privvmpages_{lim} = \infty</math>
== Setting ==
vzctl set 777 --ram 512M --swap 1G --save
== Convert non-vswap VSwap CT to Vswap VSwap ==
If you have an existing container with usual UBC parameters set, and you want to convert this one into VSwap enabled config, here's what you need to do.