MySQL stops working occassionally

I am running a 1GB ram 12.04 Ubuntu droplet and using it as a web server. Occasionally, MySQL will just stop working.

I have maybe 4 small sites that don’t receive very much traffic at all.

I originally started out with 512mb ram and was having the same kind of issues, but then I enabled swap space and that seemed to help a little, but I was still having issues. Then I upgraded to 1GB and I was great for a few days.

But then this morning, boom. I had to SSH into my droplet and “service mysql restart” to get it up again.

I’ve installed some monitoring software to help diagnose my problems.


8:10 Free Memory - 444mb Free Swap - 502mb Buffers - 69mb MySQL - UP HTTP - 17ms CPU - 0.3%

8:15 Free Memory - 75mb Free Swap - 502mb Buffers - 69mb MySQL - UP HTTP - 16ms CPU - 8.3%

8:20 Free Memory - 484mb Free Swap - 502mb Buffers - 65mb MySQL - UP HTTP - 16ms CPU - 20.1%

8:25 Free Memory - 465mb Free Swap - 502mb Buffers - 65mb MySQL - UP HTTP - 15ms CPU - 5.7%

8:30 Free Memory - 52mb Free Swap - 0mb Buffers - 0mb MySQL - DOWN HTTP - 565ms CPU - 22%

8:35 Free Memory - 679mb Free Swap - 454mb Buffers - 1mb MySQL - DOWN HTTP - 15ms CPU - 16%

8:40 Free Memory - 662mb Free Swap - 456mb Buffers - 4mb MySQL - DOWN HTTP - 16ms CPU - 0.3%

What are some steps I can take to figure out what is causing this?

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I know that this is an old thread, but I have the same issue on two of my droplets so I’d like to share my progress thus far.

dmesg hints that mysqld went down due to lack of available memory. The mysql.log and mysql.err has nothing.

Found this thread when searching for people with a similar issue on digitalocean. Apparently, this is a common problem beyond digitalocean.

People have suggested on some blogs to optimize the my.cnf, which for me is in /etc/mysql/my.cnf I’m at a stage were I’m trying to figure out which variables to alter in the my.cnf in order resolve the case.

I’ll update everyone if I come up with a solution. Thank you.

Check your MySQL logs to see why mysqld is stopping and what error it encounters. Best place to start.

I had the same issue on a 512MB droplet running WordPress. The only way i got this working was by swapping out Apache for Nginx. Haven’t had any problems since, but i can’t get caching to work, so that’s another problem. <br> <br>I wished i had known about these issues before i signed up sigh <br> <br>I would suggest you look at this setup, also look into “easyengine” thats what i am doing.