The vm.swappiness parameter for Linux 2.6 kernels is based on a scale
from 0 to 100. The default is 60 and it is known to serve Oracle RDBMS
related workloads statistically the best.
The swappiness defined
by this parameter, is for a raw and general priority paging. This is
about prioritizing the page-out of pages from anonymous vs. file-backed
memory. Anonymous memory would be the private memory areas of the
processes generally. File-backed memory is the area of memory where a
file is mapped into using mmap(). It applies to different filesystems
like ocfs2 or ext3.
The “buffers” area that we see in the “free”
command output, or meminfo etc. is also file-backed memory, a subset of
file-backed memory nowhere mmap()’d. Basically if we have a lot such
I/O, we will have larger filesystem buffers dynamically no matter we
use Direct I/O or not. That can be checked from /proc/meminfo or free
Regarding the different values for the parameter:
* More swappiness tends to prefer to page out anonymous memory more.
* Less swappiness avoids pageout of anonymous memory more.
Paging
files are a simpler compared to anonymous memory, and having a low
swappiness can help with the performance. But this really depends on
how much the workload needs the free anonymous memory and free
file-backed memory. For Oracle RDBMS like workloads, the file-backed
memory is critical and it is not a good ide to have related memory
paged-out.