Skip to content

Instantly share code, notes, and snippets.

@ivankravchenko
Last active March 9, 2016 23:14
Show Gist options
  • Save ivankravchenko/11169416 to your computer and use it in GitHub Desktop.
Save ivankravchenko/11169416 to your computer and use it in GitHub Desktop.
digitalocean create /swapfile
fallocate -l 1G /swapfile
chown root:root /swapfile
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile
echo /swapfile none swap sw 0 0 >> /etc/fstab
echo vm.swappiness = 10 | tee -a /etc/sysctl.conf
echo vm.vfs_cache_pressure = 50 | tee -a /etc/sysctl.conf
sysctl -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment