Question

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

Posted November 11, 2021 86 views
NginxMySQLPHPLaravel

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
https://ibb.co/tbrZdMm
https://ibb.co/FsZr739

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.

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.

×
Submit an Answer
1 answer

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.