Last active
March 13, 2017 18:05
-
-
Save dongalor/10e39b752aa187f9e761e42066a674e2 to your computer and use it in GitHub Desktop.
turn on swap file and configure swappiness
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
sudo swapon -s | |
sudo dd if=/dev/zero of=/swapfile bs=1024 count=256k | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
swapon -s | |
sudo vim /etc/fstab | |
/swapfile none swap sw 0 0 | |
echo 10 | sudo tee /proc/sys/vm/swappiness | |
echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf | |
sudo chown root:root /swapfile | |
sudo chmod 0600 /swapfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment