Setting Swap Ec2

Setting Swap EC2 #

In this example dd command, the swap file is 4 GB (128 MB x 32):

sudo dd if=/dev/zero of=/swapfile bs=128M count=32
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab