It is one of feature available in Linux operating system which is responsible degree to which the kernel prefers to swap memory to fulfil the system memory requirement. The parameter value varies from 0 to 100. In Linux system default value set to 60. A low value result kernel will try to avoid swapping unless there is almost RAM is full for process on system. The higher value would force kernel aggressively to moved out memory pages from the physical memory to swap memory.
If we set higher value then there may be negative impact on the system cause when system accessing the swap memory (which is part of the hard drive) then system operations being bit slow as compare to the RAM as RAM is faster than the hard drive. To read/write system directly on hard drive will take time so it’s best to avoid transfer active memory pages to swap memory aggressively.
To check the default value use command:
# cat /proc/sys/vm/swappiness
60
-To modify the parameter use command:
#echo 40 > /proc/sys/vm/swappiness
-To affect the changes use :
# sysctl -p
-Verify the parameter use :
# sysctl -a | grep swappiness
vm.swappiness = 40