Quick Understanding on swap

Swap Space is virtual memory, using your HDD when you run out of memory. The system swaps some of the contents out of the RAM to the HDD (swap), then bring it back when required.

In the past, when RAM was very small in the single digit of GB or less, we take the rule of 2 times the memory. But with large memory available in your Server, it may not be necessary to configure as much, as we only need as much as we can suspend to disk. I like to use between 16GB to 32GB swap

To control the tendency for the system to use the swap. Configure the vm.swappiness at /etc/sysctl.conf. It is the percentage of memory free before using swap. If you have lots of memory, you can use it as low as 10 from the default 60.

Do take a look at Quick Understanding on Swap