Setting swappiness parameter to zero
Setting the swappiness parameter to zero ensures that application pages will not be moved to swap space.
The swappiness parameter influences the kernel preference to move
memory pages from applications to swap page, versus reclaiming memory
from the cache. After system restart, set the swappiness parameter
to zero. This ensures that if memory is constrained, the page cache
is reduced in an attempt to recover memory before application pages
are moved to swap space:
echo 0 >/proc/sys/vm/swappiness
This setting might improve or degrade the performance of an application. Because there is adequate memory already dedicated to this workload, large amounts of memory would not need to be swapped to disk. Because precautionary (early) swapping is now avoided, the study results are free of the effects of this kind of swapping.