Swap | Is it really needed?
From what i know it is more a failsafe to keep your server from crashing if it runs out of ram. But I need to be sure so i am asking here.
My current dedicated server running WHM/Cpanel has more ram than I'll probably ever use and runs on SSD drives so disk space is it a premium.
So if I have more ram than what will ever be used do I really need to add a swap file?
-
]From what i know it is more a failsafe to keep your server from crashing if it runs out of ram. But I need to be sure so i am asking here. My current dedicated server running WHM/Cpanel has more ram than I'll probably ever use and runs on SSD drives so disk space is it a premium. So if I have more ram than what will ever be used do I really need to add a swap file?
It's not necessary, but it is recommended. My own company does not provide swap files/partitions with our virtual private servers as we discovered far too many people taking out low spec servers with cPanel/WHM and the combined system I/O across those servers swapping memory in and out resulted in substantial performance degradation. You'll find a lot of VPS web hosts do not provide swap by default. Some will allow you to use a swap file, but not all. Martyn0 -
Great information movielad. Thank You. 0 -
Hello :) I've moved this thread to our "Optimization" forum. Thank you. 0 -
It's important. You can avoid the kernel's OOM killer from shutting down services like MySQL abruptly. If hosts allows you can manually add swap using the following commands as root: fallocate -l xG /swapfile chmod 600 /swapfile mkswap /swapfile swapon /swapfile
xG = in gigabytes. Eg. 8G for 8gb swap. Auto swapon during boot. Edit /etc/fstab and add at the end:/swapfile none swap sw 0 00
Please sign in to leave a comment.
Comments
4 comments