Change swappiness in Ubuntu

Linux uses a swap partition, that represents the system’s virtual memory. The swappiness represents how often the system will copy stuff from RAM to disk/virtual memory. The more RAM you have, the less you need to copy to disk and by setting the swappiness to a lower value will result in an overall speed increase.

#check current value
cat /proc/sys/vm/swappiness

#edit /etc/sysctl.conf and append the following line
vm.swappiness=10