vm.swappiness is one of the Kernel Parameter in Linux or UNIX, vm.swappiness value is from 0-100 which controls the swapping of application data from physical memory to virtual memory on disk, and alternatively Swappiness is a setting that controls how often the kernel copies the contents of RAM to swap. You can set the value of the vm.swappiness parameter for minimum swapping.
The higher the parameter value, the more aggressively inactive processes are swapped out from physical memory. The lower the value, the less they are swapped, forcing filesystem buffers to be emptied.
On most systems, By default vm.swappiness is set to 60. This is not suitable for Hadoop clusters because processes are sometimes swapped even when enough memory is available. This can cause lengthy garbage collection pauses for important system daemons, affecting stability and performance.
Cloudera recommends that you set vm.swappiness to a value between 1 and 10, preferably 1, for minimum swapping on systems where the RHEL kernel is 2.6.32-642.el6 or higher.
You need to add below entry to /etc/sysctl.conf in end of the file .
# cat /etc/sysctl.conf | grep -i swap vm.swappiness=1