Question
Droplet consistently high memory usage, causing out of memory errors (Mysql)
I’m running Ghost (a publishing software) version 3.14.0, self-hosted on a DigitalOcean droplet via Docker containers (ghost and mysql in separate containers). I’ve been experiencing sudden spikes in CPU usage that brings down the database, as shown in the graphs.
You can view all related logs and memory usage statistics here.
You can see how the CPU spikes suddenly to 100% even though it usually barely uses 1%. I’ve narrowed down the problem to be caused by the MySQL container, bringing down the db.
It seems to be an out of memory error, but I don’t know why the droplet is using up so much memory. It has 1GB RAM, and from the statistics, it’s barely using 30-40% of that, yet the graphs show a consistent 90% RAM usage.
Not sure why the graphs show so much memory is used even though I’m only using at beast 40-50% memory. Should I add swap or some other thing?
Does anyone have any idea how to fix this issue? The server randomly crashes due to this (luckily, thanks to Docker, it restarts immediately). I can’t pinpoint the exact reason either - running top doesn’t show anything, and I can’t access the server through ssh during the flareup. Thank you!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
Now I’m thinking of adding swap to solve this problem somewhat, but the DigitalOcean guide for adding swap seems to discourage this. I don’t think I need to be upgrading to a higher tier based on my usage, so should I just add swap?
Does swap affect anything if I’m running everything in Docker containers?