Editing VSwap

Jump to: navigation, search

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 96: Line 96:
  
 
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.
 
== Details about vSwap implementation in Virtuozzo 7 ==
 
 
The Container swapping process is similar to that on a standalone computer.<br>
 
This means in particular that some pages may get into the swap even if there is some free memory reported in the Container.<br>
 
This may validly happen in case kernel memory management system detects some anonymous memory which is not touched for a long time by Container processes and decides that it's more
 
efficient to put these anonymous pages into the swap and use more caches in a Container instead.
 
 
The Container swap space resides in physical node swap file.<br>
 
When the swap-out for a Container starts, appropriate number of pages are allocated in physical swap on the host. Next
 
# if there is no free memory on the host, the real swap-out of Container's memory to physical swap happens
 
# if there is free memory on the host, the Container's memory is saved in a special swap cache in host's RAM and no real write to host's physical swap occurs
 
 
{{Note|The physical swap space is allocated in both cases anyway, this guarantees all amount of host's swap cache for Containers memory can be written into physical swap on host in case the host gets short of RAM.}}
 
 
* '''Consequence 1''': without any configured node swap file the Container's `SWAPPAGES` parameter will be ignored.
 
 
* '''Consequence 2''': if node's swap size is less than sum of all Containers' swap sizes on the node, Containers won't be able to use 100% of their swap simultaneously - similar to RAM settings.
 
  
 
== See also ==
 
== See also ==

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Template used on this page: