Swap File - Size Change & Performance.

wdavies

New Member
Dec 31, 2021
3
0
1
53
New to Proxmox.
I have a 4 GB swap, but recently upgraded to 16GB of RAM on the node. I read around a few posts, but didn't see much. Would it be useful, or improve performance, by increasing the Swap volume size? If so/not (either way), how do we change the swap size?

pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 pve lvm2 a-- 237.97g 0
lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root pve -wi-ao---- 233.97g
swap pve -wi-ao---- 4.00g
vgs
VG #PV #LV #SN Attr VSize VFree
pve 1 2 0 wz--n- 237.97g 0

Thanks All
W
 
The more is swapped the worse the performance, because data needs to be read from slow disks instead of the fast RAM.
So if you are low on RAM its more useful to buy more RAM instead of increasing your swap. Swap is useful if a process slikes and you run out of RAM so the OOM killer won't kill your VMs. But for that 4GB should be fine.
 
  • Like
Reactions: Juertes
The more is swapped the worse the performance, because data needs to be read from slow disks instead of the fast RAM.
So if you are low on RAM its more useful to buy more RAM instead of increasing your swap. Swap is useful if a process slikes and you run out of RAM so the OOM killer won't kill your VMs. But for that 4GB should be fine.
Thanks Dunuin.
So, to confirm, since I've upgraded the RAM on the machine to 16GB I don't need to worry about adjusting the Swap File size---since the machine will choose the RAM first and 16GB should be plenty?
 
Last edited:
Thanks Dunuin.
So, to confirm, since I've upgraded the RAM on the machine to 16GB I don't need to worry about adjusting the Swap File size---since the machine will choose the RAM first and 16GB should be plenty?
Right. But if 16GB is plenty depends on your needs. I got 112GB RAM in my homeservers and still could need 64GB more, so 16GB is more on the low side for a hypervisor. Just make sure you don't overcommision your RAM. So I wouldn't assign more then a combined 12GB RAM to all your VMs/LXCs together.
 
Last edited:
  • Like
Reactions: Juertes

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!