Add a swap file
Add a swap file to your Victus VPS to survive memory spikes and avoid the OOM killer when RAM is tight.
Swap is disk space the kernel uses as overflow when RAM fills up. On a smaller VPS plan a swap file is a cheap safety valve: it keeps the out-of-memory (OOM) killer from abruptly terminating your app during a brief memory spike. This is a file-based swap, so no repartitioning is required.
Swap is a cushion, not a substitute for RAM
Disk is far slower than RAM, so a machine that swaps heavily and constantly will feel sluggish. Use swap to absorb spikes; if you swap all the time, upgrade the plan for more RAM.
Create a swap file
Make it survive reboots
Do not add a duplicate fstab line
Only append the swap line once. If you run the setup twice, check /etc/fstab and remove any duplicate /swapfile entry, or boot will error.
Tune how eagerly it swaps
Sizing rule of thumb
For servers, 1x to 2x your RAM is a reasonable swap size (e.g. 2-4G on a 2G VPS). Make sure you have the free disk space first with df -h — and remember swap consumes disk that counts toward your plan.