From the course: Linux System Engineer: Advanced Disk Systems and System Backup

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Change system swapiness

Change system swapiness

From the course: Linux System Engineer: Advanced Disk Systems and System Backup

Start my 1-month free trial

Change system swapiness

- [Instructor] How a Linux system decides to swap out RAM to the swap file is defined by its swappiness. Higher values improve file system performance. A low value decreases latency at the cost of higher performance. A low swappiness value such as 10 is recommended for database workloads. We can temporarily change swappiness by changing a value in the proc file system. We'll need to make ourselves root temporarily for this. Type in sudo space S-U space hyphen. Now type in echo space 50 space greater than space slash proc slash sys slash V-M slash swappiness and hit enter. This changes the swappiness value to 50 temporarily. Now log back out of root by typing in exit. If you want the setting to survive your reboot you'll want to add a value to slash E-T-C slash sysctl slash C-O-N-F. Type in sudo space V-I space slash E-T-C slash sysctl dot C-O-N-F and hit enter. Go into insert mode and then add a line to the end of the file. In this line enter V-M dot swappiness equals 50. Save it by…

Contents