By keebs82
Every now and then, while working in my WordPress dashboard, I will get an “Error establishing database connection” (at which point I have to reboot my droplet) or “Page isn’t working. Currently unable to handle this request.” This usually happens when I’m doing something like running a virus scan or editing a bunch of posts at once (by opening them all up in separate tabs and updating them simultaneously since doing them one by one is too slow). Does this mean I need to resize my kernel? I’m currently running on the $5/mo plan with 1GB of memory. I’m about to open an ecommerce store and I’m worried that the site will go down while customers are shopping.
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!
There are two possible culprits, one is that you are running out of max connections to the DB, but it seems unlikely because you highlighted just opening a couple of tabs can sometimes cause the problem.
The second issue which is more likely is that you maybe running out of resources. Depending on what plugins you have installed in Wordpress and how you are using them it can take up a lot of memory and resources, especially if you are running a long lasting process in parallel.
What you can do is login to your droplet while you are performing these various actions and check the output of the “top” command to see how your CPU and memory usage is performing.
Normally we would recommend using something larger than a $5 droplet for Wordpress only because it can be very CPU and memory intensive.
Hello all,
This crash is most likely due to your system running out of memory. I’d suggest that you add a swap file to give yourself a bit more of a buffer. Check out this tutorial:
How To Add Swap on Ubuntu 18.04
What you can also do is to use the MySQLTuner script.
The MySQLTuner is a script written in Perl and allows you to quickly test your MySQL configuration and it gives you suggestions for adjustments to increase performance and stability.
According to the official GitHub page, it supports 300 indicators for MySQL/MariaDB/Percona Server in this last version.
To run the script you could do the following:
wget http://mysqltuner.pl/ -O mysqltuner.pl
perl mysqltuner.pl
The script would run multiple checks against your MySQL instance, all checks done by MySQLTuner are documented here.
Also as stated in the official documentation, it is still extremely important for you to fully understand each change you make to a MySQL database server. If you don’t understand portions of the script’s output, or if you don’t understand the recommendations, you should consult a knowledgeable DBA or system administrator that you trust.
As a good practice make sure to always test your changes on staging environments before implementing them on your production database.
On the same note, if you want to have worry-free MySQL hosting and focus on your application, I would recommend trying out the DigitalOcean Managed Databases:
https://www.digitalocean.com/products/managed-databases-mysql/
Hope that this helps! Regards, Alex
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.