6,534
edits
Changes
VSwap
,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'''.
* '''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.