Changes

Jump to: navigation, search

VSwap

1,529 bytes added, 15:57, 17 July 2020
vswap in vz7 details added
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 ==

Navigation menu