Swap not disabled on host

plastilin

Renowned Member
Oct 9, 2012
108
5
83
Ukraine
Hello. Try to disable swap on host, but it still using after reboot. WTF?

Overall swap used: 770635 kB

========================================
kB pid name
========================================
87831 2737 pvedaemon
84142 2786 pveproxy
78496 2740 pvedaemon worke
78333 2742 pvedaemon worke
78314 2741 pvedaemon worke
68187 17386 pveproxy worker
68072 17983 pveproxy worker
66688 21301 pveproxy worker
55816 2817 spiceproxy
53232 2820 spiceproxy work
23944 2766 pve-ha-crm
19808 2810 pve-ha-lrm
5192 2606 pvestatd
2544 2594 pve-firewall
36 356 systemd-journal

root@alpha:~# sysctl vm.swappiness
vm.swappiness = 0

top - 00:03:42 up 3:37, 1 user, load average: 1,12, 1,23, 1,20
Tasks: 243 total, 2 running, 152 sleeping, 0 stopped, 0 zombie
%Cpu(s): 7,8 us, 5,7 sy, 0,0 ni, 86,4 id, 0,1 wa, 0,0 hi, 0,0 si, 0,0 st
KiB Mem : 57700780 total, 362768 free, 47137252 used, 10200760 buff/cache
KiB Swap: 8388604 total, 8191996 free, 196608 used. 9898992 avail Mem
 
Hi,

if you set vm.swappiness to 0 this does not disable swap.
0 is only one index before 1 and nothing more.

To turn of swap you have to remove the fstab entry and for hot-remove call swappoff
 
Well thank you. What would you recommend using Swap? I think the default setting of 60 is a lot. A 0 does not disable. Can use 5 or 10?
 
I would use 0 as the lowest possible index for swap.
But keep in mind you will still swap, also if you have enough memory free.
This happens if memory in the RAM is not used for a long time.

This is the case at ZFS with the ARC.
There are indexes in the memory that are not accessed for a long time, but the arc is not full so it will stay in it.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!