Droplet Management Basics

November 10, 2015 655 views
WordPress Apache Linux Commands Ubuntu

Hi, some of our droplets (running wordpress) are experiencing the dreaded: "error establishing a database connection"

It's happening too much for my liking and we are considering a moving away from DO if we can't resolve it soon.

I am trying to learn SSH commands for logging in and controlling / managing a server.

The droplets are Wordpress sites running on Ubuntu.

I understand how to login, but i am sure there are a lot of useful commands i need to learn such as restarting the server etc.

I would greatly appreciate any help you have on this, and any commands which you think would be useful based on the above setup (Ubunto / Wordpress)

4 Answers

Why would it make you move away from DO? You'll run into it with any VPS no matter where.
Check your syslog for OOM killer on mysqld. If it's there, upgrade your droplet or use less RAM.

Thanks for your reply.

Could you provide details on: "Check your syslog for OOM killer on mysqld"

Thanks again for your help.

@mosaic - Errors are not specific to DigitalOcean and could pop up for any number of reasons on any VPS deployed to any provider and at any time if the software, MySQL in this case, is not tweaked and / or tuned properly. You could "downgrade" to shared hosting, though you would, as a result, lose the ability to customize your server and would thus be stuck with whatever configuration the shared host sets.

The specific connection error that you're referencing could be due to poor configuration (such as RAM being over-allocated), lack of configuration or problems elsewhere. To really dive deep in to the error and the configuration, MySQL Tuner should be used (as I referenced in another post of yours IIRC). It will allow you to see how much RAM could potentially be used by MySQL (note: if MySQL is configured to use more RAM than the Droplet is allocated and swap won't cover the excess, MySQL is going to crash as MySQL will use whatever it's allocated).

That said, there's not a specific one-shot variable that tells MySQL how much RAM it can use (when compared to MemCached or Redis, which has one configuration variable for RAM allocation). MySQL uses a combination of InnoDB settings as well as buffers, query cache etc to allocate RAM. If these are set too high, MySQL will naturally crash as a result of lack of RAM/Memory.

Problem solved with this code..

sudo start mysql

Beautiful Jogja - Indonesia

Have another answer? Share your knowledge.