Hello,
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:
- SSH to your Droplet
- Download the script:
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 a 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/
This was mini tutorial was posted from @bobbyiliev in this question in our community: https://www.digitalocean.com/community/questions/how-to-tweak-mysql-mariadb-configuration-for-increased-performance-and-stability
Hope that this helps!
Regards,
Alex
I had the same issue on the $5/month plan before, seemed due to MySQL running out of resources. Have you set up swap?
Most likely low RAM and OOM issues. That is why my MYSQL used to crash every couple of days.
Had 0 crashes since I did this :)
@adityars Could you share little more detail or provide a tutorial for your setup? Little nervous messing around the my.cnf.
How do you set up swap?!
@karlonC: Take a look at this tutorial: How To Add Swap on Ubuntu 14.04.
@kamaln7 Actually it was enabled from server pilot.
Hi Alevsk, how did you solve this issue? I am having same issue even with 1GB RAM. Could you please let me know if you find any solution? Thank you
Hi kothintl, I just add a swap partition in my dropplet and then enable slow queries in mysql to identify in which if my sites was the problem
Only remove innodb support if you know none of your plugins need it. I do not know for sure if WordPress blocks innodb, but I use it in some tables in my various other projects so that I can perform certain search functions.
Besides, shouldn’t it restart automatically after a crash?? Isn’t that what a SERVICE is about?