How does MySQL manage memory?

February 14, 2018 476 views
MySQL LAMP Stack CentOS
zkarj
By:
zkarj

I have a 1GB memory Droplet on which I am trying to run a LAMP stack with (so far) a few WordPress sites. For a lot of the time everything runs fine, but now three times in less than a week MySQL has crashed. On each occasion it appears to have attempted a restart when connections reached zero.

I've researched many questions and tutorials on DO and checked for XML-RPC attacks (possibly, but not near the time of the MySQL crash) and tried configuring more memory by default, but I am not winning.

What I don't understand is why, when MySQL seems to restart itself when connections reach zero, that it was running fine, for possibly over 24 hours, and then it does not have enough memory to restart? Two of the three times I was able to simply restart it and all was fine for a while. This morning I could not get it to start at all, but a server reboot solved it and it has been running for 10 hours since.

Is there something I can do to placate MySQL, or do I have to upgrade the memory on my Droplet, and in that case, how far do I need to go?

1 Answer

HI,
Check your config for mysql. How many simultaneous connection do you allow? That to me is the source of most memory errors.

Have another answer? Share your knowledge.