LVMのありなしで、MySQLの性能にどれだけ影響がでるか実験

LVMには、いろいろな機能があって便利なのですが、これってMySQLの性能に影響があるんでしょうか。
ふと気になってしまったので、ベンチマークを行ってみました。
VirtualBox上にUbuntu 9.10 Server 64bitをインストールして、sysbenchを実行しています。

パラメータは、以下の通り。


$ sysbench --test=oltp --oltp-table-size=1000000 --num-threads=4 --max-requests=0 --max-time=180 --oltp-test-mode=complex --mysql-user=root --mysql-password=password run
全部終わったあとに、VirtualBoxのCPU数が1なのに、スレッド数を4にしていたことに気づきました。
なので、あくまで参考データとして見てください。


LVMなし


OLTP test statistics:
queries performed:
read: 693084
write: 247530
other: 99012
total: 1039626
transactions: 49506 (275.03 per sec.)
deadlocks: 0 (0.00 per sec.)
read/write requests: 940614 (5225.52 per sec.)
other operations: 99012 (550.06 per sec.)

Test execution summary:
total time: 180.0038s
total number of events: 49506
total time taken by event execution: 719.6868
per-request statistics:
min: 2.25ms
avg: 14.54ms
max: 436.74ms
approx. 95 percentile: 28.78ms

Threads fairness:
events (avg/stddev): 12376.5000/876.25
execution time (avg/stddev): 179.9217/0.01


LVMあり


OLTP test statistics:
queries performed:
read: 813540
write: 290550
other: 116220
total: 1220310
transactions: 58110 (322.82 per sec.)
deadlocks: 0 (0.00 per sec.)
read/write requests: 1104090 (6133.60 per sec.)
other operations: 116220 (645.64 per sec.)

Test execution summary:
total time: 180.0068s
total number of events: 58110
total time taken by event execution: 719.6735
per-request statistics:
min: 2.06ms
avg: 12.38ms
max: 287.33ms
approx. 95 percentile: 21.37ms

Threads fairness:
events (avg/stddev): 14527.5000/178.51
execution time (avg/stddev): 179.9184/0.00


LVMなしの方がパフォーマンスが高いと予想していたのですが、結果が逆になってしまいました。う〜ん、なんでだろう。
今度、時間があるときに、その理由を調べてみたいと思います。