Friday, July 4, 2014

Swap File for low end dev servers

I have a Digital Ocean Vps, but only for hobby projects. So it has merely 512Mb memory. If you want
to run multiple applications on a small development server you can operate with more memory, just use swap files.

"Swap space will allow the operating system to temporarily move data from memory onto the disk when the amount of information in memory exceeds the physical memory space available"

Of course it will be much slower. Fortunately D.Ocean has only Ssd hard drives, so Ssd improves the situation.

Here are the bash lines from a Digital Ocean article:

sudo fallocate -l 1G /swapfile; sudo mkswap /swapfile; sudo swapon /swapfile

Create an empty 1Gb file; Format to swap space; Enable it
This swap file remains until the next reboot!

No comments:

Post a Comment