Ghost Digital Ocean Droplet Memory / Set Up Swap File Issue
SITUATION
To be able to have more than 2 Ghost blogs on a DigitalOcean 512mb droplet one need to increase the memory by adding swap space.
Basically one can not have more than two Ghost blogs on a DigitalOcean 512mb droplet as the memory will cut out and force at least one instance to shut down. It happened daily to me before I discovered the reason why. Each Ghost instance apparently uses 80-120mb of memory so the maximum Ghost blogs you could have on a DigitalOcean 512mb droplet is two.
What's the answer?
You need to add more memory to your server.
Either by upgrading your droplet at Digital Ocean or adding a swap file.
Use this excellent tutorial to add a swap file:
How to ADD swap on Ubuntu Linux at Digital Ocean
I would recommend only setting up a 512 MB swap file. If you find yourself needing more swap than that, you may want to consider a bigger droplet, as swap is not a replacement for more RAM.
And if, in the future, you want to change the size of the swap space, you can use this tutorial
How to CHANGE swap size on Ubuntu Linux at Digital Ocean
INFORMATION ABOUT THE PROS & CONS OF ADDING A SWAP FILE
How to configure a virtual memory swap file
CONCLUSION
I think a 100-pages Ghost Blog instance just needs between 80-120MB of memory per instance under normal operation. It may need more memory during installs and upgrades but that is just temporary. Your server needs around 100-150MB of memory just to run so you should plan for 200MB per Ghost install. Basically:
- one 512MB droplet can safely host two Ghost instances
- one 1GB droplet can safely host at least four Ghost instances
and so on...
Naturally, all this changes depending on how much traffic you have coming to your site but above figures should reflect low to normal traffic and server load. This page explains it very well:
What memory usage to expect with Ghost on a 512mb droplet
I now have FOUR ghost blogs running simultaneously on ONE Digital Ocean 512MB Droplet and everything is chugging along just fine - YAY!
UPDATE
Turns out that having four Ghost blogs running simultaneously is still too much for a Digital Ocean 512MB Droplet (even with the added swap file).
Basically one was crashing once a week. Better than once a day but still....
I now only run three blogs and so far so good. See uptime here: http://stats.skillshub.info
UPDATE 2
Turns out that blogs would still crash once in a while so my final conclusion is that on a Digitalocean 512MB Droplet, the max number of Ghost blogs should not exceed two unless you are willing to upgrade the droplet to 1GB.
With a 1GB Digitalocean Droplet, you can run 4 Ghost blogs.
Reference Links:
https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04
https://www.digitalocean.com/community/tutorials/how-to-configure-virtual-memory-swap-file-on-a-vps
https://www.digitalocean.com/community/questions/is-this-memory-usage-normal-in-ghost-512mb-droplet
https://www.digitalocean.com/community/questions/how-to-change-swap-size-on-ubuntu-14-04