Site Tools


start:swappiness

This is an old revision of the document!


Table of Contents

The default swappiness of Linux in general is 60 which works very well. 100 means it moves things out of RAM into swap as soon as possible and 0 means try avoid using swap.

In General I have tried different values but found 60 offers the most convenient value, however sometimes I change it to 70 in order to use zramswap more aggressively if memory is used heavily. However if you want to experiment yourself you can try this:

Check current value:

cat /proc/sys/vm/swappiness

Change value temporarily until reboot. You can type the above command again to see it changed:

sudo sysctl vm.swappiness=50

Change permanently:

sudo nano /etc/sysctl.conf

if the 'vm.swappiness=xx' line does not exist in that file, then add it to the bottom of the file (must not be commented out) and change value as appropriate eg: vm.swappiness=50

ctrl x and y to save.

Notes

Notes: If anyone has any other notes or useful commands regarding swap, add them here.

TLDR: 60 or 70 are good values. 60 for normal systems, 70 if you use zramswap and lots of memory for some reason (eg:VM's).

start/swappiness.1677818232.txt.gz · Last modified: 2023/03/03 04:37 by peter