Problem with Wordpress and MySQL connection when i publish/edit a post

  • Posted November 15, 2013

First of all, I’m using Google translator because my native language is Spanish. So sorry for the mistakes!

Now, the main problem: Currently I have a 512MB Droplet with Wordpress which was configured with this tutorial ( The problem I have now is that every time I post something or edit any post, it takes too long to respond and then appears a message saying that the Wordpress lost connection to the database. Obviously stopped and restarting MySQL returns everything to normal. What I notice is that when publishing the post, the CPU gets too high, almost 80%. What is what could be happening? I know is something related to MySQL and his configuration, but i´m not able to figure it out.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

<b>“Is there a chance to change the droplet configuration to varnish and nginx?”</b> <br> <br>Yes. Simply execute: <br><pre>sudo apt-get -y remove --purge apache2</pre> <br>Then, follow the instructions in the guide referenced above.

Thanks for the answer!! <br>I already added swap memory (1GB), wich help a lot, but the problems continues. <br>Is there a chance to change the droplet configuration to varnish and nginx?

It’s too bad that the DigitalOcean’s one-click WordPress install uses Apache; given that Nginx w/caching provides MUCH better performance (especially on a 512MB droplet). To address your current problem, add swap. <i>See</i> <a href=“”>How To Add Swap on Ubuntu 12.04</a>. <br> <br>If you want a WordPress installation that can handle heavy loads (especially on a 512 MB droplet), check out <a href=“”>How To Install Wordpress, Nginx, PHP, and Varnish on Ubuntu 12.04</a>.