LAMP Stack, Ubuntu 14, using virtual host, mysql crashes daily but for only one website the other is unaffected?

Posted May 1, 2017 1.8k views

I’ve already upped the innodb buffer to 64mb, applied the recommended Apache tweaks. These sites are hosted on a 1GB dropplet, running 2 WP sites. I haven’t tried SWAP, but I’m thinking it’s not a RAM issue since only one site crashes while the other remains operational. I could be wrong .... about the RAM … any ideas on where I should start looking? Thanks in advance.

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.

Submit an Answer
3 answers

Hi @N8Ting

Define “crashes” - do you have any logs or what’s the error?
Do not add SWAP to DigitalOcean droplets - it will become slower, just add more RAM if needed.
I would probably have a look at the recommendations from MySQL Tuner based on your database statistics:

“Crashes” probably isn’t the correct word since the other site is unaffected. I get the “error establishing database connection” message on screen. If I restart Mysql it’s back up and running. I’m pretty new to this whole thing, I’ve tried to find the error logs, the only log I did manage to find only had the activity from when I restarted mysql this morning. Recommendations on which log files to view? Again, I appreciate the help.

  • @N8Ting
    You can find usually find you MySQL log in /var/log/mysql/error.log
    Are you connecting to MySQL the same way on both sites? Meaning are you connecting through localhost and port 3306 - or are you using a socket.

Good morning and thank you for working with me. The error log you mentioned is the one I previewed but only had info from when I restarted Mysql. The site has not failed since yesterday morning, so I’ll continue to watch and when it fails again I’ll dig into the error log then. As far as I know they connect in the exact same way using localhost.