Optimize MySQL with MySQLTuner
MySQL load can be really heavy on some servers, especially if you are hosting big communities, reducing the load of MySQL is in that case is essential. To help us achieving this task we will use MySQLTuner.
MySQLTuner is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability.
Download MySQLTuner :
cd /usr/local/src
wget http://mysqltuner.com/mysqltuner.pl
Make it executable :
chmod 0755 mysqltuner.pl
Run the script :
./mysqltuner.pl
Note: you may be asked to enter the MySQL root password, if yes, please provide.
The MySQLTuner output is separated into 5 parts as below:
General Statistics / Storage Engine Statistics / Security Recommendations / Performance Metrics / Recommendations
You should go through all parts especially on the Recommendations. It’s the main part which summarizes everything you need to step by step review your MySQL installation or make changes on some settings in the configuration file (usually located in /etc/my.cnf or /etc/mysql/my.cnf).