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 1: | Line 1: | ||
'''New [[Download/kernel/rhel6|RHEL6-based OpenVZ]] kernel''' has a new memory management model, which supersedes [[UBC|User beancounters]]. It is called '''VSwap'''. | '''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 two primary parameters: <code>ram</code> and <code>swap</code> (a.k.a. <code>physpages</code> and <code>swappages</code>), while all the other beancounters become secondary and optional. | |
− | |||
− | |||
* '''physpages''' | * '''physpages''' | ||
− | : This parameter sets the amount of fast physical memory (RAM) available to processes inside a container, in memory pages. | + | : This parameter sets the amount of fast physical memory (RAM) available to processes inside a container, in memory pages. |
− | |||
: The <code>barrier</code> is ignored and should be set to 0, and the <code>limit</code> sets the limit. | : The <code>barrier</code> is ignored and should be set to 0, and the <code>limit</code> sets the limit. | ||
+ | : Currently (as of >= 042stab042) the user memory, the kernel memory and the page cache are accounted into <code>physpages</code>. | ||
* '''ram''' | * '''ram''' | ||
Line 15: | Line 13: | ||
* '''swappages''' | * '''swappages''' | ||
: This parameter sets the amount of "slower memory" (vswap) available to processes inside a container, in memory pages. | : This parameter sets the amount of "slower memory" (vswap) available to processes inside a container, in memory pages. | ||
− | |||
: The <code>barrier</code> is ignored and should be set to 0, and the <code>limit</code> sets the limit. | : The <code>barrier</code> is ignored and should be set to 0, and the <code>limit</code> sets the limit. | ||
Line 31: | Line 28: | ||
{{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>.}} | {{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>.}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Setting == | == Setting == | ||
Line 68: | Line 37: | ||
vzctl set 777 --ram 512M --swap 1G --save | vzctl set 777 --ram 512M --swap 1G --save | ||
− | == Convert non- | + | == Convert non-vswap CT to 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. | 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. | ||
Line 76: | Line 45: | ||
# 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 54: | ||
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 == | ||
− | * [http://openvz.livejournal.com/39644.html On vSwap and 042stab04x kernel improvements] | + | * [http://openvz.livejournal.com/39644.html On vSwap and 042stab04x kernel improvements]] |
− | * [http://openvz.livejournal.com/39765.html Recent improvements in | + | * [http://openvz.livejournal.com/39765.html Recent improvements in VSwap] |
[[Category: UBC]] | [[Category: UBC]] |