Problems with large number of posts (Wordpress)

Posted July 23, 2013 5.1k views
I have a Wordpress Blog with ~ 6K posts. In the past when I used a shared hosting, my hosting company said that I used too many CPU. They asked me optimized and indexed my database. I bought a clound hosting (512 MB memory) since few days.but some time when I connect to my blog, there is a error 'Error establishing a database connection", and I must restart mySQL. Did someone have the same issue ? Please help. Thank you

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
5 answers
Another option would be to optimize the my.cnf file so it uses less RAM, possibly limiting maximum concurrent connections and increasing some cache values.
MySQL is probably crashing due to running out of RAM.
I recommend upgrading your droplet to a larger one so you have enough RAM for everything.
@Kamal Nasser : Thank you. Do you think 1GB RAM is enough ?
It depends on the site's load really. Try scaling up to 1GB and load-testing the website (I personally recommend to see if that's enough. You should also optimize the my.cnf file as sb73542 mentioned.