Disable swap on host

puertorico

Renowned Member
Mar 30, 2014
40
9
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...