By nvak92
I have installed 20 wordpress websites in one droplet. But cpu useage does not exeed 10%. Some times my servers are hanged and it shows error establishing database connection. How can i solve it.
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!
It could be to not enough RAM available. If your service ran out of memory, it’ll get killed and you can have problem like above.
You can look for logs. Start with syslog:
- nano /var/log/syslog
Look there for entries like OOM, OOM killer, proccess killed, out of memory. If you find that logs, it means that you don’t have enough RAM.
If you can’t find logs there, you can also look for alternative location /var/log/messages.
In case this is the problem upgrading Droplet or installing Swap would do the job. How To Add Swap on CentOS 7 or for CentOS 6 How To Add Swap on CentOS 6.
I had the same issue a while back, and yes, it was the RAM running out taking down MySQL with it. Increasing the RAM size and adding swap fixed that for me. Swap though degrades SSD drives so opt for an increase in RAM if you have the budget for it but swap will do if you’re tight on cash.
Back then, I used New Relic to monitor my servers that helped me identify the issue. You might want to look into monitoring tools to help you manage yours as well.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.