Search For Answers
MySQL Tuner
Last updated: March 29, 2011
... is a Perl script that will help with your MySQL configuration and recommend changes for performance and stability.
[root@host /]# wget http://mysqltuner.com/mysqltuner.pl
[root@host /]# /usr/bin/perl mysqltuner.pl
Sample Output
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Enable the slow query log to troubleshoot bad queries
Reduce or eliminate persistent connections to reduce connection usage
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
max_connections (> 250)
query_cache_size (> 8M)
tmp_table_size (> 32M)
max_heap_table_size (> 128M)
table_cache (> 96)
Can't find perl?
[root@host /]# which perl
/usr/bin/perl
Play it safe and backup my.cnf prior to modification.
[root@host /]# cd /etc ; cp my.cnf my.cnf.bkp