Tweak the swapinness

What is swappiness and why should I change it?

swappiness is a value between 0 and 100 which controls the priority of your system using ram vs. swap.  Making this change will greatly increase the performance of your Linux system (server and desktop).

A swappiness value of 0 means avoid swap as much as possible and only use ram.

A swappiness value of 100 means avoid ram as much as possible and only use swap.

By default most popular distros like CentOS, RHEL, Debian, Ubuntu and Mint are preset for a swappiness of 60.

I recommend using a value between 5 and 10

How to I check the swappiness?

Run the following command to check the current swappiness value:

cat /proc/sys/vm/swappiness

To temporarily change it, execute the following command:

sudo sysctl vm.swappiness=10

To set the value permanently on the system, edit the following file:

nano /etc/sysctl.conf

And add the following line if it isn't there yet:

vm.swappiness=10
  • 1 کاربر این را مفید یافتند
آیا این پاسخ به شما کمک کرد؟

مقالات مربوطه

crontab management

crontab is a command line tool in order to manage your cron tasksThe two most important basic...

[EA3] New Relic APM on cPanel & CloudLinux CageFS

Many System Administrators tried to get PHP apps hosted on a cPanel server with CloudLinux and...

[WHM/cPanel] Update WHM/cPanel using CLI

Occasionally, WHM or cPanel might experience errors that can only be resolved by updating the...

[WHM/cPanel] Changing Home directory

What is the document root? When you visit a website, you are accessing a particular folder on...

Installing GeoIP (PECL) on WHM

In order to install GeoIP via PECL on a WHM enabled server, you must first install 2 modules:1)...

Powered by WHMCompleteSolution