Last active
November 16, 2018 10:32
-
-
Save adw0rd/d20dfa01cb7a9ccf29ab4946b369a48c to your computer and use it in GitHub Desktop.
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
swapon -s | |
cp /etc/fstab /etc/fstab.bak | |
# For 4 CPU Core create 4 swap files: | |
for i in $(seq 0 3); do | |
fallocate -l 1G /swapfile$i; | |
mkswap /swapfile$i; | |
swapon /swapfile$i -p 10 | |
echo "/swapfile$i none swap sw 0 0" >> /etc/fstab; | |
done | |
swapon -s | |
cp /etc/sysctl.conf /etc/sysctl.conf.bak | |
echo 'vm.swappiness=10' >> /etc/sysctl.conf | |
echo 'vm.vfs_cache_pressure=50' >> /etc/sysctl.conf | |
sysctl -p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment