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:
-
Connect to the server using SSH.
-
Update the value temporarily:
# sysctl vm.swappiness=10
-
For the permanent change, edit the file
/etc/sysctl.conf
and add the parametervm.swappiness
:# echo "vm.swappiness = 10" >> /etc/sysctl.conf
Additional information
What are recommended requirements of SWAP, RAM and Disk space for Plesk Onyx?