Hello, How can i Set Swap Partition on 2GB of memory on the Ubuntu 18 or Ubuntu 20 server.
For server with 2 GB of memory, it is recommended to set 2 GB (2048MB) swap partition to improve system performance.
sudo dd if=/dev/zero of=/swapfile count=2048 bs=1M
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
free -m
+8595670151
7 days a week, 24 hours a day