MySQL keeps crashing on 512MB Droplet

  • Posted September 29, 2014

Reading some other posts here it seems that using the smallest Droplet is prone to cause issues with MySQL. Lately the number of crashes has increased and I now have to restart MySQL several times per week, I really need to solve this.

What I’ve tried so far:

  • Updated the server using apt-get
  • Added a swap file
  • Checked MySQL logs for errors, nothing is output

I’m running the WordPress preinstall Droplet and for the site I’m using only 2 plugins, neither which are running any cron jobs. The site in question is Any ideas?


This comment has been deleted

Try to see what process is using more ram. It’s so easy to see it using: htop

I had the same issue before using joomla, so I decided to change http apache by nginx, because apache was using too much memory and collapsing the droplet. After the replacement I don’t have that problem again.

Btw, I also have a droplet with 512mb RAM


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.

You may also want to try a different theme…maybe just one of the default WordPress themes. Sometimes developers will write some hefty functions into themes that can cause problems.

I run several different droplets that are 512mb, WordPress sites on each of them with no problems. I did have to hunt down an issue on one of the droplets, but it turned out to be a wp-cron.

Also, there are couple of other things to check:

How much traffic does your site get? Do you have analytics installed so you can look at that?

Do you do anything to guard against brute-force attacks? If not, you should at least use login-lockdown plugin, which can help. It will also log any false attempts to login.

If you install that plugin, and then look in the settings an hour later and see tons of login attempts, then that could be a problem (but there are solutions…)

Also, do you have any other applications installed like phpMyadmin? Just to get a full picture of what is going on.

And finally, here is a script that will restart MySQL for you if it goes down:

that will not solve your problem, but it will at least keep your website up while you trouble-shoot.

miguelalcaino - thanks for suggesting htop. I can see that currently I’m using about 1% CPU, 148/490 RAM, and my Swap uses 55/255 (as MySQL is up and running). Are those numbers supposed to match up 512 together? Otherwise that’s probably the cause.

sierracircle - Thanks for pointing those out. I’ve made sure not to have any phpMyAdmin folder present, and I’m running my own theme which utilize very little WP functionality. Also, traffic is low (below 100 visitors / day). Reg brute force attacks, I haven’t actually looked into that. Will try the plugin you mentioned and see if there might be any issues.


I remember I have seen a similar topic before and there, the reason for crash was a large swap… So by any chance do you have a very large swap file ??