swappiness

Swappiness

TLDR: Swappiness is a configurable parameter in the Linux Kernel that controls the system's tendency to use swap memory in place of physical RAM. Represented as a value between 0 and 100, it determines the balance between keeping data in RAM versus moving it to swap space. Properly tuning swappiness is critical for optimizing system performance and minimizing latency under different workloads.

https://en.wikipedia.org/wiki/Swappiness

A lower swappiness value (e.g., 10) prioritizes keeping data in RAM, making it ideal for applications that require fast memory access, such as databases or gaming. Conversely, a higher swappiness value (e.g., 60) increases the likelihood of swapping idle processes, which can be beneficial in systems with limited RAM or workloads with a mix of active and inactive tasks. The default value of swappiness is typically 60 on most Linux distributions, offering a balanced approach for general-purpose use cases.

https://www.kernel.org/doc/html/latest/admin-guide/sysctl/vm.html

Swappiness can be adjusted dynamically using the `sysctl` command or by modifying the `/etc/sysctl.conf` file for persistent changes. Linux monitoring tools like `vmstat` and `Linux top` help identify swap usage patterns, enabling informed Linux tuning of swappiness. By optimizing this Linux kernel parameter, Linux administrators can improve Linux system responsiveness, reduce Linux disk I/O, and extend SDD longevity and hard disk longevity, particularly in memory-intensive applications or resource-constrained environments.

https://man7.org/linux/man-pages/man5/sysctl.conf.5.html

swappiness.txt · Last modified: 2025/02/01 06:26 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki