Skip to content

Instantly share code, notes, and snippets.

@dongalor
Last active March 13, 2017 18:05
Show Gist options
  • Save dongalor/10e39b752aa187f9e761e42066a674e2 to your computer and use it in GitHub Desktop.
Save dongalor/10e39b752aa187f9e761e42066a674e2 to your computer and use it in GitHub Desktop.
turn on swap file and configure swappiness
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