Article ID: 123244, created on Oct 24, 2014, last review on Oct 24, 2014

  • Applies to:
  • Virtuozzo 6.0


How much swap should I allocate to the server? What kernel parameters should be used?


Use the following guidelines when deciding on how much disk space should be allocated to the swap partition on a PCS node:

up to 4 GB2 GB
4-16 GB4 GB
16-64 GB 8 GB
64-256 GB16 GB
256-512 GB32 GB

SWAP usage can be configured using the following parameters:

  • Swappiness is used to define how aggressively the kernel swaps out anonymous memory relative to pagecache and other caches. Increasing the value increases the amount of swapping. The default value is 60.
  • vfs_cache_pressure controls the tendency of the kernel to reclaim the memory which is used for caching of VFS caches, versus pagecache and swap. Increasing this value increases the rate at which VFS caches are reclaimed.


# sysctl -w vm.swappiness=20  
# sysctl -w vm.vfs_cache_pressure=100 

The values are approximate, you may change them according to your needs. To make these parameters permanent, add the corresponding lines to "/etc/sysctl.conf":

# grep vm /etc/sysctl.conf
vm.swappiness = 20
vm.vfs_cache_pressure = 100    

Note: decreasing SWAP usage will boost server performance only if the amount of physical RAM on the node is greater than the total amount of RAM allocated to containers and virtual machines.

Search Words




c62e8726973f80975db0531f1ed5c6a2 2897d76d56d2010f4e3a28f864d69223 0dd5b9380c7d4884d77587f3eb0fa8ef

Email subscription for changes to this article
Save as PDF