Editing VSwap
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 35: | Line 35: | ||
Since vzctl 4.6, if some optional beancounters are not set, vzctl sets them implicitly, | 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: | The following formulae are used: | ||
Line 45: | Line 45: | ||
<math>vmguarpages_{bar} = vmguarpages_{lim} = ram + swap</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> | : <math>privvmpages_{bar} = privvmpages_{lim} = (ram + swap) \times vm\_overcommit</math> | ||
− | + | otherwise: | |
: <math>privvmpages_{bar} = privvmpages_{lim} = \infty</math> | : <math>privvmpages_{bar} = privvmpages_{lim} = \infty</math> | ||
Line 76: | Line 69: | ||
# Add PHYSPAGES and SWAPPAGES parameters to config. Easiest way is to use <code>vzctl set $CTID --ram N --swap M --save</code> | # Add PHYSPAGES and SWAPPAGES parameters to config. Easiest way is to use <code>vzctl set $CTID --ram N --swap M --save</code> | ||
− | Now your config is vswap enabled, and when you (re)start it | + | Now your config is vswap enabled, and when you (re)start it, vswap mechanism will be used by the kernel for this CT. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== How to distinguish between vswap and non-vswap configs? == | == How to distinguish between vswap and non-vswap configs? == | ||
Line 96: | Line 78: | ||
In addition, vzctl checks if kernel support vswap, and refuses to start a vswap-enabled container on a non vswap capable kernel. The check is presence of <code>/proc/vz/vswap</code> file. | In addition, vzctl checks if kernel support vswap, and refuses to start a vswap-enabled container on a non vswap capable kernel. The check is presence of <code>/proc/vz/vswap</code> file. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== See also == | == See also == |