1. First of all, you decreased total swap space from 12 GB to 8 GB. Why would you do that? Swap should always be plenty...
2. Also, there is a sysctl variable that controls the aggressiveness of swapping, you can check it with the following command:
Code:
# sysctl vm.swappiness
vm.swappiness = 1
It is already set on all my nodes to 1, which means it will do the least amount of swapping possible. For virtual machine hosting, 1 is the recommended value by Red Hat, IBM, etc.
You also want to set another sysctl value to prevent running out of memory when doing certain tasks:
Code:
# sysctl vm.min_free_kbytes
vm.min_free_kbytes = 262144
The above is a good value for servers having at least 8 GB of RAM.
To make the above changes permanent, you have to add them to sysctl.conf which gets executed on boot:
Code:
echo "vm.min_free_kbytes=262144" >> /etc/sysctl.conf
echo "vm.swappiness=1" >> /etc/sysctl.conf
sysctl -w
3. Finally, is your system installed on ZFS? If yes, and your swap partition is on a zvol (rpool/swap), then you need to set a few other things, because the default Proxmox install crashes if there is too much memory being swapped out to ZFS without these settings:
Code:
zfs set primarycache=metadata rpool/swap
zfs set secondarycache=metadata rpool/swap
zfs set compression=zle rpool/swap
zfs set checksum=off rpool/swap
zfs set sync=always rpool/swap
zfs set logbias=throughput rpool/swap
You can copy and paste these into a shell, it's enough to execute them once and you won't crash more. The default Proxmox install does not set them, even though the ZFS on Linux FAQ includes them as important tunables.
You can find a few more memory tweaks in this thread:
https://forum.proxmox.com/threads/f...sts-during-high-io-on-host.30702/#post-159242