Last active
February 7, 2016 08:11
-
-
Save bitamar/83075ab2901601a40c0f to your computer and use it in GitHub Desktop.
Add swap to ubuntu 14.04
This file contains hidden or 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
# Add a 1G swap to swapless ubuntu server. (Verify with: free -m) | |
# Adapted from https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04 | |
fallocate -l 1G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
sysctl vm.swappiness=10 | |
echo vm.swappiness=10 >> /etc/sysctl.conf | |
sysctl vm.vfs_cache_pressure=50 | |
echo vm.vfs_cache_pressure=50 >> /etc/sysctl.conf | |
free -m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment