High Swap usage

telvenes

Member
Oct 5, 2020
20
2
8
34
I have 98% in use on one of my servers, i have also activated cache on a drive is this the reason my swap is full? Or does it has anything to say?
 
Used swap doesn't necessarily has to be a bad thing. See this nice writeup [0].

If you have performance issues you can try if disabling the swap helps.

Disable swap: swapoff -a then reboot the node

We know of customers where this was the case.

There is no general recommendation from our side as, with most things in life, it depends (on the hardware, load, ...). However you can run top command to see what the service take the swap

[0] https://chrisdown.name/2018/01/02/in-defence-of-swap.html
 
I have one Proxmox (with ZFS) that does not use swap unless I backup a VM with cache=writeback, then it fills the swap completely and makes everything slow. I have another Proxmox (without ZFS, with only containers running) that puts 35% of the used memory in swap, but it is never slow. Both systems have vm.swappiness=10. It is really unclear why Linux does what it does with swap and when... Although the two systems swap usage is completely different, both work fine (as long as I don't use cache=writeback for VMs).
 
It is really unclear why Linux does what it does with swap and when...
I've got 64GB RAM with 64GB swap and never saw more then 400MB of data swapped out at any time. Even if I set swappiness to 100 and RAM is over 80% used. Swap is really strange...
 
Is there a way to se what uses the SWAP? I do not use ZFS so that is not it. My systems are fast and fine so that is not problem. just wondering why
 
I did not get much wiser after this, but i think it is the writeback that is the cause of this
 

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!