Skip to content

Instantly share code, notes, and snippets.

@githubutilities
Created January 20, 2016 02:20
Show Gist options
  • Save githubutilities/7ce0181c7d6ed8d75b94 to your computer and use it in GitHub Desktop.
Save githubutilities/7ce0181c7d6ed8d75b94 to your computer and use it in GitHub Desktop.
Swappiness

Swappiness

# The default swappiness in Ubuntu 60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment.
# Checkout swappiness value
cat /proc/sys/vm/swappiness

# Switch swap off
sudo swapoff -a

# Set new swappiness, set it to 0 if you want to disable swap
sudo sysctl vm.swappiness=10

# Switch swap on
sudo swapon -a

# Monitor virual memory(swap) every 1 second
vmstat 1

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment