よかろうもん!

アプリからインフラまで幅広くこなすいまどきのクラウドエンジニアが記す技術ブログ

innotopを使ってみた

innotopバージョン1.6.0をインすトールしてみまっす。
ソースコードは以下から落としてくる。
$ wget http://downloads.sourceforge.net/innotop/innotop-1.6.0.tar.gz?modtime=1194607129&big_mirror=0

展開
$ tar xvzf innotop-1.6.0.tar.gz ; cd innotop-1.6.0/

Makefileの生成
$ perl Makefile.PL
実行すると以下のような出力があり、Makefileが生成されます。

Checking if your kit is complete...
Looks good
Writing Makefile for innotop

最後にインストール
$ sudo make install

インストール後は、innotopコマンドでリアルタイムにDBの性能を閲覧することができるんですが、
初回実行時に接続先などを聞かれます。
今回はhttp://object.serveblog.net/2007/10/19/214を参考にして設定しました。



使い方がよくわからないので、まずはMySQLへ発行されたコマンドのサマリを表示してみることに。

___________________ Command Summary ____________________
Name Value Pct Last Incr Pct
Com_admin_commands 3042 26.69% 2 40.00%
Com_show_status 2005 17.59% 2 40.00%
Com_select 1893 16.61% 0 0.00%
Com_show_fields 958 8.41% 0 0.00%
Com_show_variables 917 8.05% 1 20.00%
Com_show_engine_status 833 7.31% 0 0.00%
Com_show_tables 488 4.28% 0 0.00%
Com_show_processlist 360 3.16% 0 0.00%
Com_insert 269 2.36% 0 0.00%
Com_begin 130 1.14% 0 0.00%
Com_commit 130 1.14% 0 0.00%
Com_update 107 0.94% 0 0.00%
Com_alter_table 54 0.47% 0 0.00%

まだMySQLをほとんど利用していないため、こんな内容になってます。


ヘルプで確認すると内部コマンドは以下のようなものがあるとのこと。

Switch to a different mode:
B InnoDB Buffers I InnoDB I/O Info Q Query List
C Command Summary L Locks R InnoDB Row Ops
D InnoDB Deadlocks M Replication Status S Variables & Status
F InnoDB FK Err O Open Tables T InnoDB Txns

Actions:
a Toggle the innotop process k Kill a transaction's connection
c Choose visible columns n Switch to the next connection
d Change refresh interval p Pause innotop
e Explain a thread's query q Quit innotop
f Show a thread's full query r Reverse sort order
h Toggle the header on and off s Change the display's sort column
i Toggle inactive transactions x Kill a query

Other:
TAB Switch to the next server group / Quickly filter what you see
! Show license and warranty = Toggle aggregation
# Select/create server groups @ Select/create server connections
$ Edit configuration settings \ Clear quick-filters

インストールと初期動作の確認までできたので、
これからDBに負荷をかけてみて、どのように各指標が変化していくのかを確認してみます。
はやく使いこなせるようになろっと。