Skip to content

Instantly share code, notes, and snippets.

@ertankayalar
Forked from docapotamus/swappiness.md
Created March 6, 2024 08:58
Show Gist options
  • Save ertankayalar/a1e1cceaff1cdd2893efe748d24153f7 to your computer and use it in GitHub Desktop.
Save ertankayalar/a1e1cceaff1cdd2893efe748d24153f7 to your computer and use it in GitHub Desktop.
Setting swappiness on Debian

Swappiness controls the tendancy the kernel wishes to swap.

Even with free memory the kernel may swap.

100 means aggressively swap 0 means wait until the last minute to swap

To check current swappiness cat /proc/sys/vm/swappiness

To change it live sudo sysctl vm.swappiness=0

To change it after reboot sudo vim /etc/sysctl.conf

Change the value of vm.swappiness if it doesn't exist then add it to the bottom:

vm.swappiness=0

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