Tuesday, August 20, 2013

add swap to ec2 ubuntu

You can add a 1 GB swap to your instance with these commands:
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024
sudo mkswap /swapfile
sudo swapon /swapfile
To enable it by default after reboot, add this line to /etc/fstab:
/swapfile swap swap defaults 0 0

No comments:

Post a Comment