Why is my Website very unstable and keeps going down? Why is MySQL maxing out my CPY?

August 3, 2017 94 views
MySQL Server Optimization WordPress DigitalOcean PHP Ubuntu

Hi over the last few days i have been getting server timeout and the website hanging, and from what i can see it is saying that MySQL is causing this by looking at the monitor graphs in the DO dashboard.

I have not changed anything on the site since this started apart from updating plugins as normal and updating and changing some stock. I have reverted to the older plugins just in case also, but its still the same.

I have even upgraded to the next droplet, even though it was fine beforehand

It just keeps maxing out the cpu and then the website crashes. Unfortunately i am clueless to this technical stuff and the person who helps me with this site is away and unreachable(great timing i know!) so im desperate for any help(bearing in mind i dont have much technical ability - I have done websites in past on my own, but used managed websites un like DO)

I have attached my MySQL log as i read somewhere this may be useful but i dont know what it even means.

Link to Logs from MySQL

Any help or advice desperately needed.

1 Answer

Hi @andylettis

Can you run top or htop (might need to install first sudo apt install htop) and monitor which processes are taking a lot of resources.

If you're running WordPress or another heavy CMS, then you might be hit with large number of requests, so have a look in your access log:

tail -f /var/log/apache2/access.log
# Press CTRL+C to exit monitor

I'm not going to look through 130 MB of MySQL slow log. We're only interested in the error logs, but the problem is most likely not MySQL.

Have another answer? Share your knowledge.