How to set Swappiness permanent to 0 on Proxmox 9

Ralf Wolbers

New Member
May 3, 2025
15
2
3
On Proxmox 8,4 the following two Commands set swappiness permanent to 0:

sysctl -w vm.swappiness=0

echo "vm.swappiness=0" | tee -a /etc/sysctl.conf

The value stays 0 after Reboot. On Proxmox 9 it does not save it permanent. After Reboot it is 60 again
 
Why would you do this? There are good reasons for swap even on hosts with more than enough memory:
https://chrisdown.name/2018/01/02/in-defence-of-swap.html

You could use even part of your RAM as a cimpresses swap device reduing iotimes and giving more headram before memory runs out: https://pve.proxmox.com/wiki/Zram

See also: https://forum.proxmox.com/threads/recommended-amount-of-swap.171319/post-798247
I've seen that same article, @Johannes S .

One of the reasons messing with swap at all is so frustrating is that's so dependenet on the individual build.

Proxmox's default ZFS-based install doesn't even create a swap at all:
1757036170027.png
 
  • Like
Reactions: Johannes S
  • Like
Reactions: UdoB