Decrease swap usage (Swappiness)
Decrease swap usage (Swappiness)
Disclaimer: Only recommended for users with >=16GB RAM.
If you hadn’t manually opted to go with “no Swap,” then your Linux Mint system will automatically dedicate a particular amount of space as the “Swap partition.” By default, Linux is configured to move inactive pages/processes out of the RAM and into the Swap partition. When that particular page/process is again called, it will load it back from the Swap partition to the RAM.
In theory, this mechanism is designed to improve performance by freeing up RAM so that apps and processes that need it can now use it efficiently.
There is another feature called swappiness, where the Linux kernel actively controls how much and how often the RAM content gets moved to the swap partition. It uses a parameter value between 0-100 where 100 indicates aggressively moving RAM content into the Swap partition.
By default, the swappiness value is set to 60. This is good if your system uses <4GB RAM.
You can check the swappiness value on your system by typing the following command in your terminal:
cat /proc/sys/vm/swappiness
However, if your system has more than 16GB RAM, then such high swappiness will do more harm than good. Since RAM is a much faster form of memory than regular storage space, having files moved to the Swap partition will result in loss of performance when you already have enough RAM available.
As such, it is advised you keep the swappiness value down to 10.
Now to change the swappiness value to 10, open the sysctl.conf file by type in the following command in your terminal:
sudo nano /etc/sysctl.conf
Add the line vm.swappiness=10 at the bottom of the file, as shown in the image.
Change swappiness value
Mon 24 May 2021 02:16:04 PM UTC - permalink -
-
http://