Created
June 2, 2015 17:49
-
-
Save jdiamond/361eaadb18d43fcaeb8c to your computer and use it in GitHub Desktop.
Enable swapfile on Ubuntu
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
# create the swapfile: | |
fallocate -l 1G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
# enable it: | |
swapon /swapfile | |
sysctl vm.swappiness=10 | |
sysctl vm.vfs_cache_pressure=50 | |
# make it permanent: | |
echo '/swapfile none swap sw 0 0' >> /etc/fstab | |
echo 'vm.swappiness=10' >> /etc/sysctl.conf | |
echo 'vm.vfs_cache_pressure=50' >> /etc/sysctl.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment