Skip to content

Instantly share code, notes, and snippets.

@svfat
Created April 24, 2016 20:37
Show Gist options
  • Save svfat/64d7be933750f3b0e3cd2b9973c72f73 to your computer and use it in GitHub Desktop.
Save svfat/64d7be933750f3b0e3cd2b9973c72f73 to your computer and use it in GitHub Desktop.
Enable swapfile
#!/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