PVE 5.0 Swap Usage

andy77

Renowned Member
Jul 6, 2016
248
13
83
41
Hello@all,

I have recognized that on some of my new PVE5.0 nodes the SWAP is used by arround 99% even if there is still arround 30% of RAM free. Why does this happan?

Any ideas?

Thx
 
You can change the swappiness like...
Code:
sysctl vm.swappiness

# you can set it temporary
sysctl vm.swappiness=0

# change it in "/etc/sysctl.conf"

vm.swappiness=0
 
Not sure I'd change it to 0 - which totally disables swap. Most experts suggest sappiness=10 for server workloads with adequate RAM installed. 0 could lead to fault/shutdown if something goes off the reservation and gobbles ram.
 
No, 0 do not disable swap. It uses swap only when it is out of RAM. If the server really swaps with, you need more memory.
 
BTW: I have the feeling that a VM got restarted because of SWAP got to 100% (even if RAM still available), is this possible?
I had situations where all ram and even swap was consumed and the host was locking up. So the whole machine was out of memory and unable to fulfill requests. In my case I had forgotten to limit the ZFS cache on one of my servers. That's why i asked you if you're using ZFS. But for you there might something else consume more and more memory, can you check which processes are taking high amounts of memory?

But I can't think of one VM running out of memory because the host memory is getting low since the memory is allocated when the machine is started and never taken away. At least I never had this.

What is KSM doing on your system? Is your shared pages level high?
You can monitor this with
Code:
watch cat /sys/kernel/mm/ksm/pages_sharing
 
Hi, I am not using KSM. So I do not "overuse" the available RAM (because of performance issues with KSM).
My System is showing that I do have arround 20GB of free RAM (the node has 64GB RAM installed), so this is the reason why I don't understand my 6GB SWAP partition beeing used 100% without a reason.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!