Skip to content
Home » Linux » What is Swappiness and How to Change it?

What is Swappiness and How to Change it?

Swappiness is a value from 0 to 100 which determines the degree of utilizing swap (the virtual memory). A value of 100 means that the system will always swap all idled processes out of physical memory. A value of 0 means that the system will swap processes only when the physical memory runs out.

Let's see the current value of swappiness
[root@test ~]# cat /proc/sys/vm/swappiness
60

60 is the default value of Enterprise Linux 6. But you are free to change as your needs, e.g. 20.
[root@test ~]# sysctl vm.swappiness=20
vm.swappiness = 20

If you want the value persist in the system, you can add the value to /etc/sysctl.conf like this:
[root@test ~]# vi /etc/sysctl.conf
...
vm.swappiness=20

Leave a Reply

Your email address will not be published. Required fields are marked *