昨日に引き続き、MySQLのベンチ

今日は、下記の設定を追加して、測定してみました。
/etc/mysql/my.cnf


[mysqld]
default-character-set = utf8
skip-character-set-client-handshake


sysbench 0.4.10: multi-threaded system evaluation benchmark

No DB drivers specified, using mysql
WARNING: Preparing of "BEGIN" is unsupported, using emulation
(last message repeated 3 times)
Running the test with following options:
Number of threads: 4

Doing OLTP test.
Running mixed OLTP test
Using Special distribution (12 iterations, 1 pct of values are returned in 75 pct cases)
Using "BEGIN" for starting transactions
Using auto_inc on the id column
Threads started!
Time limit exceeded, exiting...
(last message repeated 3 times)
Done.

OLTP test statistics:
queries performed:
read: 2430666
write: 868095
other: 347238
total: 3645999
transactions: 173619 (964.54 per sec.)
deadlocks: 0 (0.00 per sec.)
read/write requests: 3298761 (18326.29 per sec.)
other operations: 347238 (1929.08 per sec.)

Test execution summary:
total time: 180.0015s
total number of events: 173619
total time taken by event execution: 719.1074
per-request statistics:
min: 1.50ms
avg: 4.14ms
max: 177.53ms
approx. 95 percentile: 12.17ms

Threads fairness:
events (avg/stddev): 43404.7500/403.63
execution time (avg/stddev): 179.7769/0.00


クエリパフォーマンスが約4.5%性能ダウン。
たったこれだけで、結構変わるものですね。まぁ、この程度なら、許容範囲ですが。


他に、innodb_buffer_pool_sizeなんかもいじってベンチしてみたのですが、逆にスコアが下がってしまいました。
単純にメモリを増やせばいいというわけでもなく、なかなか奥が深いですね。
やはり、本番機と同じDB構造、データでベンチしながら、少しずつ調整していった方がよさそうです。