Query re: "normal" Swap use behaviour in Proxmox / Latest

fortechitsolutions

Renowned Member
Jun 4, 2008
434
46
93
Hi,

I've got a Proxmox host running (OVH "template deployed stock proxmox latest" (currently is displaying in webUI, Virtual Environment 5.2-7) - it has 8 HT Xeon cores / 32gb ram / pair of 2x2Tb Sata drives in SWRaid1. Pretty typical OVH box.

I have about a dozen LXC based VMs running, and no KVM VMs. Ram and CPU are slightly ovecommitted 'strictly speaking' but real-world, all the VMs are running with light CPU and ram use requirements / none of them are remotely 'saturating' any allocated resources.

From the 'summary' page on proxmox, it shows that ram use is around 18% (approximately 6gb in use) and CPU is bouncing between 1-10% but never visibly higher than this. However, swap is shown as 96% utilization, just under 2 gigs used / for 2 gigs total swap configured.

Swap was setup here as part of the 'stock ovh template'. I didn't add more swap because we have more physical ram than appears to be required, so I had presumed that more swap was not needed.

When I look through all the VMs 'summary' pages, they all tend to have swap use listed, in a low number range (approx 20-100megs per VM; a few of them show zero). None of them show physical ram use anywhere near 'high'.

All the LXC VMs are configured explicitly with some 'swap' in the 'resources' tab. Typically amount of swap is same as physical ram - so a LXC VM with 1Gb ram allocated also has 1Gb swap allocated. for example.

So, my puzzle / which I am seeing comments if possible?

- should I be concerned that proxmox main panel shows most of 2gigs swap is in use? Given that we have >50% physical ram free currently I don't think I believe we are truly ram stressed here. There are no performance issues on any of the VMs.

- is there an easy way to push swap use back down, that does not involve reboot of proxmox ?

- should I contemplate, increase my swap allocation in proxmox (ie, add a page file manually on bulk disk, and add this to my swap file, more or less) ? Would that somehow make swap happier / more responsive - to have a bigger swap pool available? Since this server was template-provisioned it has a smaller swap than I might have normally deployed (ie, typically for 32gig ram server and lots of disk space I would just give it 32gigs swap for example -- normally).

I don't know if anyone else has experience with this / or any comments / about why swap is being 'held' despite an apparent surplus of physical ram.

Any comments are greatly appreciated!

Thanks,

Tim Chipman
 
Hi,
- should I be concerned that proxmox main panel shows most of 2gigs swap is in use? Given that we have >50% physical ram free currently I don't think I believe we are truly ram stressed here. There are no performance issues on any of the VMs.
You need no memory pressure to use the swap.
It is enough when you have memory sections that are not used for a while.
You can influence this behavior a bit by setting the swappiness.

is there an easy way to push swap use back down, that does not involve reboot of proxmox ?
swapoff <dev> will push back the swap and disable the swap.

- should I contemplate, increase my swap allocation in proxmox (ie, add a page file manually on bulk disk, and add this to my swap file, more or less) ? Would that somehow make swap happier / more responsive - to have a bigger swap pool available? Since this server was template-provisioned it has a smaller swap than I might have normally deployed (ie, typically for 32gig ram server and lots of disk space I would just give it 32gigs swap for example -- normally).
No there is no need of increasing the swap.
 
Thanks very much for this feedback. Sounds like - things are managing themselves smoothly / and this is default-expected behaviour / not of concern. So that is good news.

Many thanks,

Tim
 

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!