Last active
September 14, 2016 12:32
-
-
Save ericfourrier/3a7fe258db0978bd121038ef67571513 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Swap should take place on the Instance Storage (ephemeral) disk and not an EBS device. | |
# Check that your ephemeral storage is mounted sudo mount /dev/xvda2 /mnt | |
sudo dd if=/dev/zero of=/mnt/swapfile bs=1M count=16348 # create 16G swap | |
# Permission | |
sudo chown root:root /mnt/swapfile | |
sudo chmod 600 /mnt/swapfile | |
# Activate swapfile | |
sudo mkswap /mnt/swapfile | |
sudo swapon /mnt/swapfile | |
# add this to /etc/fstab | |
/mnt/swapfile swap swap defaults 0 0 | |
# Activate swap | |
sudo swapon -a | |
# Config file to settle option | |
sudo nano /etc/sysctl.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment