MySQL TunerでMySQLチューニング

* 本ページはプロモーションが含まれています

サーバ引っ越しで、少しメモリが増えたので、MySQLでもチューニングしてみた。

まずは、チューニングプログラムをダウンロード 

$ wget https://raw.github.com/rackerhacker/MySQLTuner-perl/master/mysqltuner.pl

実行権限を付加 

$ chmod +x mysqltuner.pl

実行 

MySQLが起動してて、root権限を持っている環境で、実行

$  ./mysqltuner.pl

 MySQLTuner 1.2.0 – Major Hayden major@mhtx.net
 Bug reports, feature requests, and downloads at https://mysqltuner.com/
 Run with ‘–help’ for additional options and output filteringPlease enter your MySQL administrative login: root
Please enter your MySQL administrative password:
——– General Statistics ————————————————–
[–] Skipped version check for MySQLTuner script[OK] Currently running supported MySQL version 5.5.22
[OK]Operating on 64-bit architecture
——– Storage Engine Statistics ——————————————-
[–] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
…略
Variables to adjust:
query_cache_size (>= 8M)
tmp_table_size (> 16M)
max_heap_table_size (> 16M)
thread_cache_size (start at 4)

my.cnfを修正 

上記の「Variables to adjust:」を参考に/etc/my.cnfを修正していく