Swap does not start

Hi,
please post the output of cat /proc/swaps and check the value in cat /proc/sys/vm/swappiness, which controlls how aggressively the kernel tries to swap. Default should be 60. Also check and share the output of free -m.
 
Yes, I set up swap a few hours ago
But my other server has been running for several days and is still not using swap
1675941449536.png
 
Last edited:
It's been 12 hours and swap is still not enabled. Do I need to restart pve?

1675954288334.png
 
Last edited:
Last edited:
My physical memory is not enough, I have to use swap to be able to, now how to open swap is a problem, is it necessary to restart it?
 
Last edited:
My physical memory is not enough, I have to use swap to be able to, now how to open swap is a problem, is it necessary to restart it?
No, a restart will not have an effect in this case. As I stated before, swap might behave unexpectedly in combination with ZFS, see https://forum.proxmox.com/threads/swappiness-value-is-being-ignored-100-ram-being-used.95598/

Here the recommendation would be to reduce the ZFS ARC cache limits in order to gain some more memory for other processes.

In general, swap is not recommended as it will have a huge performance impact, especially for VMs.
 
I have 128 gigabytes of RAM. How much should I limit?
echo "$[10 * 1024*1024*1024]" >/sys/module/zfs/parameters/zfs_arc_max

Is 10G okay? Like This?
 
I have 128 gigabytes of RAM. How much should I limit?
echo "$[10 * 1024*1024*1024]" >/sys/module/zfs/parameters/zfs_arc_max

Is 10G okay? Like This?
As stated in the docs, a rule of thumb is about 2GiB min + 1GiB for each 1TiB of storage. So if the ARC is for the 1.3TiB of storage, than 10GiB should be fine.

echo "$[10 * 1024*1024*1024]" >/sys/module/zfs/parameters/zfs_arc_max
Yes, note however that this will not apply if you reboot, but for a first test it is fine. To make it persistent after reboot, you have to set it via option to the zfs kernel module, as described in the docs.