Error Establishing Database Connection in Every 18 to 24 hrs

When i created my site i used this command sudo ee site create --wpredis it worked fine but i want to minify my css and html so what i did yesterday i i ran this code ee site update --wp --w3tc so this code removed the wordpress redis cache and installed w3 total cache when i click on Purge All Cache my site was briked it says that error establishing database connection

I checked wp-config.php and every thing is fine, so what i did is i reboot my digitalocean droplet and my website started working again.

But i dont know the extact time. every 18 to 24 it shows that error establishing database connection so i need to reboot my droplet to start working again.

Any one expert here please help me to solve this issue… please

I had this happening to me recently, it turned out to be memory problems with MYSQL. If its the same issue, this should help

The other thing I did was setup Monit to automatically restart MYSQL if it crashes,

I’m a total noob though, so forgive me if I’m way off the mark.


This usually happens when max_children is not aligned with memory.

Check out this -

This MySQL crash generally happens only with DO 512 plan.

The Good News is Yesterday DO updated their existing plans. DO VMs start at $5/month for 1GB RAM, 25GB.

Still best solution is use AWS Cloud.

I’ve had the exact same problem with 32GB RAM the last few days… have followed and seems to have fixed it. Will run again in 24 hours