Plesk

Why swap is required on Plesk for Linux servers?

Question

Why swap is required on Plesk for Linux servers?

Answer

Linux OS itself requires swap, but not Plesk.
It is important to consider that Linux kernel uses swap space by copying chunks from RAM to swap space allowing processes to use more memory than available physically. By default, the swap is used even if there is enough free RAM on the system.

For example, the output of the command below shows "30" which means that when the RAM usage reaches 70%, the swap space can be used. A lower number will avoid swapping and make your system faster:

# cat /proc/sys/vm/swappiness
30

swappiness value can be changed:

  1. Connect to the server using SSH.

  2. Update the value temporarily:

    # sysctl vm.swappiness=10

  3. For the permanent change, edit the file /etc/sysctl.conf and add the parameter vm.swappiness:

    # echo "vm.swappiness = 10" >> /etc/sysctl.conf

Additional information

What are recommended requirements of SWAP, RAM and Disk space for Plesk Onyx?

What is Swap Space?