Last active
March 9, 2016 23:14
-
-
Save ivankravchenko/11169416 to your computer and use it in GitHub Desktop.
digitalocean create /swapfile
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
fallocate -l 1G /swapfile | |
chown root:root /swapfile | |
chmod 0600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
echo /swapfile none swap sw 0 0 >> /etc/fstab | |
echo vm.swappiness = 10 | tee -a /etc/sysctl.conf | |
echo vm.vfs_cache_pressure = 50 | tee -a /etc/sysctl.conf | |
sysctl -p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment