How to Display the Swappiness Value of the System?
In this section, we will explore the steps to retrieve and display the current swappiness value of your Linux system. Utilizing the sysctl command, we can easily inspect the active swappiness setting, providing insights into the system’s memory management configuration.
Step 1: Check the Current Swappiness Setting ( sysctl )
The step consists of checking the current swappiness setting using the command sudo sysctl vm.swappiness. By default, major Linux distributions typically set the swappiness value to 60. This command provides a quick way to inspect and understand the active swappiness configuration on your system.
Command:
sudo sysctl vm.swappiness
Output:
Step 2: Check the Current Swappiness Setting (Procps)
In this step, the cat /proc/sys/vm/swappiness command is used to display the current swappiness value of the Linux system. The /proc/sys/vm/swappiness file contains the configuration parameter for swappiness, which determines how aggressively the system swaps out data from RAM to the swap space. The command simply outputs the numeric value representing the current swappiness setting.
Command:
cat /proc/sys/vm/swappiness
Output:
How to Change the Swappiness of your Linux system
In this article, we will explore the crucial aspect of Linux system optimization by exploring the “swappiness” setting. Swappiness determines the system’s tendency to swap data between RAM and disk, influencing overall performance. This article not only explains the underlying mechanics of swappiness but also provides practical insights and examples for adjusting this parameter, both temporarily and persistently, to enhance Linux performance enabled to specific hardware configurations and workloads.
Contact Us