Proxmox - Best performance - Disable swappiness

Proxmox - Best performance - Disable swappiness

I didn't focus on my hardware use these last days, but I've see a lot of SWAP usage on my Promox and ... It was bad, because it might broke my SSD !

So I read about swappiness and find this very usefull commands :

sysctl vm.swappiness=0
This will allow your system to swap when your physical memory is near to zero.
sysctl vm.swappiness=10
This will allow your system to swap when your physical is about 10 % memory remaining

So, you need to check your swappiness : cat /proc/sys/vm/swappiness and define a new limit. In my case, I don't want the SWAP to be used, so, I fix the value to 0.

# Check the current value
cat /proc/sys/vm/swappiness

# Define the new one
sysctl vm.swappiness=0

# Disable SWAP, it'll take some times to clean the SWAP area
swapoff -a

It take 15 minutes to clean the SWAP...
DELAY

# Enable the SWAP with the new value
swapon -a

# Check if well applied
cat /proc/sys/vm/swappiness

The execution is Shell JS from Proxmox !
firefox_2018-08-16_22-29-30-1