#freeze
-MySQL関連のWikiへのリンク
--[[MySQL:http://wiki.gashimax.com/index.php?MySQL]]
--MySQL 5.1
--MySQL 5.4
--MySQL/InnoDB
--MySQL/エラー
--MySQL/クラスタリング
--MySQL/サーバ移動
--MySQL/チューニング
--MySQL/バージョン
--MySQL/バックアップ
--MySQL/プロファイリング
--MySQL/ベンチマーク
--MySQL/レプリケーション
--MySQL/ロック
----
-[[【MySQLウォッチ】第25回 チューニングの指標,ベンチマークのノウハウ:http://itpro.nikkeibp.co.jp/article/COLUMN/20060403/234419/]]
-[[MySQLを使ってOSの性能のベンチマークを測る:http://lists.mysql.com/mysql-ja/151]]
* 測るもの [#k4502d1d]
-Transaction per time unit
-Response time or latency
-Scalability
-Concurrency
* ツール [#m8b58419]
** mybench [#x4346898]
--[[【MySQLウォッチ】第25回 チューニングの指標,ベンチマークのノウハウ:http://itpro.nikkeibp.co.jp/article/COLUMN/20060403/234419/?P=2]]
** sql-bench [#u20a5afd]
$ cd /usr/local/mysql/sql-bench
$ ./run-all-tests --server=mysql --user=test --log --fast
** [[mysqlslap:http://dev.mysql.com/doc/refman/5.1/ja/mysqlslap.html]] [#p50f00cd]
** [[sysbench:http://sysbench.sourceforge.net/]] [#d1969eb3]
-CPU
$ sysbench --test=cpu --cpu-max-prime=20000 run
-file I/O
$ sysbench --test=fileio --file-total-size=150G prepare
$ sysbench --test=fileio --file-total-size=150G --file-test-mode=rndrw --init-rnd=on --max-time=1800 --max-requests=0 run
$ sysbench --test=fileio --file-total-size=150G cleanup
-MySQL
$ sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=test --mysql-table-engine=myisam prepare
$ sysbench --test=oltp --oltp-table-size=1000000 --mysql-db=test --mysql-user=test --max-time=60 --oltp-read-only=on --max-requests=0 --num-threads=8 run
--InnoDBの場合は1行目を --mysql-table-engine=innodb とする
** [[Database Test Suite:http://sourceforge.net/projects/osdldbt/]] [#qbc1798f]
-[[OSDL Database Test Suiteでデータベースを評価する:http://journal.mycom.co.jp/column/system/019/index.html]]
** [[MySQL Benchmark Suite (sql-bench):http://dev.mysql.com/doc/en/mysql-benchmark.html]] ... MySQLに付属 [#k25d4fa8]
**[[Super Smack:http://vegan.net/tony/supersmack/]] [#p6646a6f]
** OSDL DBT2 and DBT3 [#e52663fa]
-[[Database Test Suite:http://osdldbt.sourceforge.net/]]
-[[Database Test Suite:http://sourceforge.net/projects/osdldbt/]]
* ツールを使うためにインストールするもの [#d646d330]
MySQLのベンチマークツールはPerlで作られたものが多く、DBI、DBDのモジュールが必要になる。インストールはDBI、DBDの順に行う。
-[[Perl のインストールに関する注釈:http://dev.mysql.com/doc/refman/5.1/ja/perl-support.html]]
** [[DBI:http://search.cpan.org/%7Etimb/DBI/DBI.pm]] [#k45377b7]
$ cd DBI-{Version}
$ perl Makefile.PL
$ make
$ make test
# make install
** [[DBD-mysql:http://search.cpan.org/dist/DBD-mysql/lib/DBD/mysql.pm]] [#gbcf220f]
$ cd DBI-mysql-{Version}
$ perl Makefile.PL
$ make
$ make test
# make install
** /etc/ld.so.conf [#t68e8d5e]
-/etc/ld.so.conf に以下を追記
/usr/local/mysql/lib/mysql
-# ldconfig