Should I leave the SWAP partition or remove it?

Nov 27, 2023
215
50
28
Netherlands
daniel-dog.com
Hello everyone,

I am planning to deploy my dedicated server into production at the start of next month.
Now, my hosting company by default creates a SWAP partition of 8GB with there automated Proxmox VE 8 installer.

Now I have red that using SWAP can really impact performance if it is used (given that it uses disk storage as RAM) and since my server has 256GB of RAM, I do not expected to be RAM constrained.
But I cannot find much info on weather or not it is better to leave the SWAP partition as is or the get rid of it.

So my question is if it is better for stability and performace to leave the SWAP as is and let Debian/Proxmox VE decide on weather or not to use the SWAP partition or should I disable SWAP and remove the partition?
 
There are different reasons why to use swap. One is to swap out memory in case you are running out of RAM so PVE doens't have to kill guests. Another is to help defragmenting your RAM so it won't run out of usable space while there is still free RAM left.
So I would keep it.
If you don't want it to seap out much set the swappiness to something low like 10, 1 or even 0.