Increasing Swap Space on a Running Ubuntu Server
You normally don’t want your servers using swap space because of the performance hit that occurs but for some operations you just can’t get around it. I’ve covered how to create a swap file before but what the swap you’ve created isn’t large enough?
This process turns out to be easy but it’s hard to locate all the information on the Internet. Because you’re disabling the swap on a server you should make sure you have enough available RAM so your processes won’t crash due to a lack of RAM. I ran this process at a time with low load so there weren’t any problems.
As always when there’s a potential for damage, I take no responsibility for any loss of data/problems you may have.
Disable the Swap
This process can take a long time as your data is brought back into RAM. I started to freak out the first time.
Recreate the Swap File
Format the File
Turn the Swap On
Scott Keck-Warren
Scott is the Director of Technology at WeCare Connect where he strives to provide solutions for his customers needs. He's the father of two and can be found most weekends working on projects around the house with his loving partner.
Top Posts
- Working With Soft Deletes in Laravel (By Example)
- Fixing CMake was unable to find a build program corresponding to "Unix Makefiles"
- Upgrading to Laravel 8.x
- Get The Count of the Number of Users in an AD Group
- Multiple Vagrant VMs in One Vagrantfile
- Fixing the "this is larger than GitHub's recommended maximum file size of 50.00 MB" error
- Changing the Directory Vagrant Stores the VMs In
- Accepting Android SDK Licenses From The OSX Command Line
- Fixing the 'Target class [config] does not exist' Error
- Using Rectangle to Manage MacOS Windows