I recently had an issue with one of my Proxmox hosts where it would max out all swap and slow down to a crawl despite having plenty of physical memory free. After digging and tweaking, I found this post which directed to set the kernel swappiness setting to 0. More reading suggested I should set it to 1, which is what I did.
Append to /etc/sysctl.conf:
#Fix excessive swap usage vm.swappiness = 1
Apply settings with:
This did the trick for me.
One thought on “Fix Proxmox swapping issue”
Don’t use vm.swappiness = 1
Try vm.swappiness = 10 or leave default (60)
Or better try :
#set -euxo pipefail
#set -euo pipefail
for module in lz4 lz4_compress z3fold
do grep -iqw “^$module$” /etc/initramfs-tools/modules || printf ‘%s\n’ “$module” >> /etc/initramfs-tools/modules
echo ‘GRUB_CMDLINE_LINUX_DEFAULT=”$GRUB_CMDLINE_LINUX_DEFAULT zswap.enabled=1 zswap.compressor=lz4 zswap.zpool=z3fold zswap.max_pool_percent=25″‘ > /etc/default/grub.d/zswap.cfg
P.s. Now ZSTD can be much better then LZ4. But ZSTD is not exist in linux kernel by default 🙁