Disable swap on host

puertorico

Renowned Member
Mar 30, 2014
40
8
73
I am running 2 servers on 4.1 with both 32gb of ram. and both with fast ssd's as mirror, the storage is therefore limited. how can i disable swap completely, the vm's will never run out of memory. ?

it look kind og different from regular debian since zfs is used, i have tried this with no luck.
swappoff /rpool/swap

is there a reason not to do this ?
 
I am running 2 servers on 4.1 with both 32gb of ram. and both with fast ssd's as mirror, the storage is therefore limited. how can i disable swap completely, the vm's will never run out of memory. ?

it look kind og different from regular debian since zfs is used, i have tried this with no luck.
swappoff /rpool/swap

is there a reason not to do this ?

Comment out the swap line within /etc/fstab and reboot. That should do the trick.
 
I put vm.swappiness = 0 in /etc/sysctl.conf

It's not a complete disable, it just wont swap unless totally out of RAM which shouldn't occur unless something unplanned for happens.
 
That's what I ended up setting. My primary server has 128GB of ram, with plenty free, so it frankly seems silly to have it ever touching swap unless necessary...
 

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!