Home > HOWTOs > How To Configure Swappiness Linux

How To Configure Swappiness Linux

How To Configure Swappiness
To find the current swappiness settings, type:
cat /proc/sys/vm/swappiness
60
Swapiness can be a value from 0 to 100.
  1. Swappiness near 100 means that the operating system will swap often and usually, too soon.
  2. Although swap provides extra resources, RAM is much faster than swap space. Any time something is moved from RAM to swap, it slows down.
  3. If we have more RAM on the server its better to leave the swappiness to a lower value like 10.
  4. Also if we are using the server as a Hadoop Datanode and has enough RAM on hand then we set it lower value.
A swappiness value of 0 means that the operating will only rely on swap when it absolutely needs to. We can adjust the swappiness with the sysctl command:
sysctl vm.swappiness=10
vm.swappiness=10
If we check the system swappiness again, we can confirm that the setting was applied:
cat /proc/sys/vm/swappiness
10
To make changes permanent, you can add the setting to the /etc/sysctl.conf file:
sudo nano /etc/sysctl.conf
Add the below line.
# Search for the vm.swappiness setting.  Uncomment and change it as necessary.
vm.swappiness=10
Advertisements
Categories: HOWTOs
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: