Articles in this section

How to prevent swap from being used by VPSes on KVM slave node?

Applicable to:

  • SolusVM

Question

How to prevent swap from being used by VPSes on KVM slave node?

Answer

According to the official RHEL documentation, each VPS is a linux process. Linux processes are not permanently kept in main memory (physical RAM) and will be placed into swap space (virtual memory) especially if they are not being used.

If a VPS is inactive for long periods of time, the host physical machine kernel may move the VPS into swap.
Also, VPSes having OS with GUI(i.e. Windows OS) actively use swap. This is by design of how KVM virtualization works.

You can try decreasing the swap usage by customizing vm.swappiness parameter in

# /etc/sysctl.conf

  • vm.swappiness - represents the percentage of the free memory before activating swap.
    The default value is 60.

The lower the value, the less swapping is used and the more memory pages are kept in physical memory.

Recommended value to improve performance when sufficient memory exists in a system is 10.

For more information about swappiness please refer here.

 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.