MySQL service going down intermittently

Hello community!
My digital ocean server with Webmin/Virtualmin runs a single WordPress site. The MySQL service has been intermittently going down and I’m trying to troubleshoot why.

Here’s my settings, which are the default for a 2GB RAM install:

The server has 1 vCPU and 2GB of RAM.

Here are some recent graphs. You will spikes over the last 24 hours for CPU and disk which correspond to the MySQL service failing and downtime.

To keep it up, I have simply been manually restarting the service. Not a great solution but since the load is intermittent it has been OK. I’d like to dig deeper but I’m not sure how. I can upgrade the hardware if needed, but I’d rather not. Is there a way to cap CPU, RAM, and/or Disk usage for MySQL so it just acts more slowly instead of just completely failing?

Thanks for your help in advance!

12-24+ load on a 1 core vCPU, which is actually only a half cpu(1 thread). :astonished: That shouldn’t be above a 1.0 load for that setup.
Have you checked the top and iotop commands during those times to see what process is causing the load. Specifically the wa%. Which is the disk wait time. If that is high, cpu load will continue to climb. The sql crash could just be a result of running out of ram becasue of some other process.

1 Like

Thanks, normal load average is 0.08-0.14 with < 10% CPU used and < 35% RAM used. I will use top next time there’s an issue and report back.

It’s been steady since 5 days ago, however today it went down again and I was able to check top. Here’s a screenshot. I’ve blanked out the user for the website owner of the affected site to protect privacy. Please let me know your thoughts. Thanks!

It’s also worth mentioning that the MySQL service was down which is why it is not displaying in these results.

After a server reboot, services are running smoothly.