LoginSignup
7
6

More than 5 years have passed since last update.

MariaDB10でsysbenchを使う

Posted at

DB: MariaDB 10.0.11
OS: Ubuntu 14.04
マシン: thinkpad t440p

sysbenchのブランチを取得してコンパイル

bzr branch lp:sysbench

configure.acの編集
AC_PROG_LIBTOOLをコメントアウト
AC_PROG_RANLIBを追加

./autogen.sh
./configure --prefix=PATH --without-drizzle --with-mysql-includes=/PATH/mariadb/include/mysql --with-mysql-libs=/PATH/mariadb/lib
make
make install

mysql-includesとmysql-libsにはmariadbをインストールしたディレクトリのincludeとlibディレクトリを指定
共有ライブラリの位置を環境変数に追加

export LD_LIBRARY_PATH=/PATH/mariadb/lib

テストデータ準備

testで指定するスクリプトはsysbenchブランチの中にluaスクリプトがいくつか用意されているのでそれを使用
table-sizeはレコード数

sysbench --test=/branch_sysbench_path/sysbench/tests/db/oltp.lua --db-driver=mysql --oltp-table-size=100000 --mysql-user=user_name --mysql-password=user_pass --mysql-host=127.0.0.1 --mysql-db=test_db_name --mysql-table-engine=innodb prepare

実行

スレッド数4,innodb_buffer_pool_sizeを4Gで実行

./bin/sysbench --test=/branch_sysbench_path/sysbench/tests/db/oltp.lua --db-driver=mysql --oltp-table-size=100000 --mysql-user=user_name --mysql-password=user_pass --mysql-host=127.0.0.1 --mysql-db=test_db_name --mysql-table-engine=innodb --num-threads=4 --max-requests=100000 --max-time=300 --oltp-test-mode=simple run

結果

sysbench 0.5:  multi-threaded system evaluation benchmark

Running the test with following options:
Number of threads: 4
Random number generator seed is 0 and will be ignored


Threads started!

OLTP test statistics:
    queries performed:
        read:                            655326
        write:                           187236
        other:                           93618
        total:                           936180
    transactions:                        46809  (156.02 per sec.)
    deadlocks:                           0      (0.00 per sec.)
    read/write requests:                 842562 (2808.36 per sec.)
    other operations:                    93618  (312.04 per sec.)

General statistics:
    total time:                          300.0197s
    total number of events:              46809
    total time taken by event execution: 1199.9333s
    response time:
         min:                                  9.63ms
         avg:                                 25.63ms
         max:                                292.34ms
         approx.  95 percentile:              36.49ms

Threads fairness:
    events (avg/stddev):           11702.2500/10.94
    execution time (avg/stddev):   299.9833/0.00
7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6