Created
April 24, 2016 20:37
-
-
Save svfat/64d7be933750f3b0e3cd2b9973c72f73 to your computer and use it in GitHub Desktop.
Enable swapfile
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
#!/bin/sh | |
fallocate -l 2G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
echo "/swapfile none swap sw 0 0" >> /etc/fstab | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment