Still preferred fallocate instead of dd to create a swap file?dd if=/dev/zero of=/swapfile count=4096 bs=1MiB && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile && echo "/swapfile swap swap defaults 0 0">>/etc/fstab
Still using swap file? Memory is cheap. I don't recall a server where I created swap partition or swap file.
Memory is NOT cheap, not at all.
It is if you own it. If you rent your hardware, yeah, it adds up.
Even if I own it, throwing away 2-3GB of RAM makes no sense. Now, if I own it, I can easily assign 4GB of RAM then remove it once installed, by why? That's harder to script and still no benefit.
It's a bad habit to see resources as cheap and so waste them just because you can. Extra memory doesn't improve performance, it hurts it (just the tiniest bit). And it's not free, if you always apply twice as much RAM as you use (or four times, here), that gets costly one way or another. Either you wasted money overspeccing in the beginning, or you are stuck buying more now.