I am wondering if there is a recommended way to completely disable swap on IncusOS. I know limits.memory.swap=false can be used for certain individual instances, but it’s my understanding that doesn’t apply to all instance types (like VMs?). Is there instead a way to disable swap on the IncusOS host itself?
For context, I am running IncusOS off of flash storage and am looking to increase longevity by reducing writes and have also noticed some performance impact to swap intensive operations due to slower speeds from the system drive. I know certain writes to the system data partition are unavoidable, but having moved everything else off the local pool I’m hoping to further reduce writes to the system drive as much as possible.
The current IncusOS documentation lists zram_swap_size under kernel memory settings. It says 0 disables existing zram-backed swap, with IncusOS attempting to apply the change without a reboot. That is narrower than disabling every possible swap device. For your flash-wear concern, the kernel documentation describes zram as compressed storage in RAM; it can use a backing device if writeback is configured, and I haven’t verified whether your IncusOS setup does that. Which IncusOS version are you running, and what swap devices does the host itself report?
A small amount of swapping out of rarely-touched pages is unlikely to increase your SSD wear noticeably, but can (perhaps counter-intuitatively) make your system perform a lot better under memory pressure.