High CPU and memory usage in the last 24 hrs on my droplet

I have a small web app that is pretty much just used by myself (so very little load) however in the last 24 hours it has had issues with high CPU usage and memory load for no obvious reasons. This high usage is also causing my MySQL database to regular lost connection in this period.

Below is a screenshot of my Digital Ocean monitoring graphs & htop stats

The app has been running fine for many weeks and it has only been in the last day that i’ve been noticing these issues - can someone assist me on this.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hi @zabius,

It’s possible you were the target of a DDoS attack or some process that stuck and caused a queue, be it with your MySQL or something else.

What I’ll recommend is to first install software like fail2ban to help you stop DDoS attacks. Cloudflare is a good option as a CDN as well.

Additionally, if the problem occurs again, see how many IPs have accessed your application, see if you can stop some if they look suspicious.