MySQL requires maintenance
Even if you’re running on a tiny VPS or on a huge server when you have a LAMP stack your biggest memory consumer will probably be MySQL. Some even prefer running it on a different machine when it comes to high traffic web apps.
But, as your apps are put to work MySQL tends to get slower, and one of the things always welcomed is to properly maintain MySQL/MariaDB. And I’ll show you the least you can do from time to time.
Download and run mysqltuner.pl
wget -O mysqltuner.pl mysqltuner.pl chmod +x mysqltuner.pl ./mysqltuner.pl
This script will run and tell you what to change in my.cnf.
Another thing you might do from time to time is checking, repairing and optimizing your tables:
mysqlcheck -c -A -p mysqlcheck -r -A -p mysqlcheck -o -A -p
So, nothing really fancy 🙂