What is swap and how to configure it to best to make our computer faster
Swap is an area on the hard disk that is used when the RAM is full, and consists in the transfer of the old processes for the introduction of the new.
How sly can be this solution, you can turn them against in case you have a computer with little RAM memory, because the process of transferring processes from RAM to swap (and vice versa) takes more CPU. The solution is to increase the margin of the filling of the RAM.
By default, the swap area begins to be used to achieve 60% of the capacity of the RAM, then to reduce the exchange processes enough for us to increase this percentage (for example 90%).
To do this, just use this Terminal command
sudo gedit /etc/sysctl.conf
At the end of the file add
vm.swappiness=10
Save and reboot the computer.