Setup swap in EC2 instance

# configure 2GB swap (1M x 1024 blocks)
sudo dd if=/dev/zero of=/swapfile bs=1M count=2048
sudo mkswap /swapfile
sudo swapon /swapfile

# add swap info to /etc/fstab
/swapfile swap swap defaults 0 0

One thought on “Setup swap in EC2 instance

  1. Pingback: Transfer WordPress to Amazon EC2 | BioInfoExpert

Leave a Reply

Your email address will not be published. Required fields are marked *