MySQL性能测试工具sysbench的安装和使用(2)

#/home/mysql/sysbench-1.0/src/sysbench --test=/home/mysql/sysbench-1.0/tests/include/oltp_legacy/oltp.lua \
--mysql-host=mysql-host-ip --mysql-port=3306 --mysql-user=envision --mysql-password=password \
--mysql-db=dbtest --oltp-tables-count=10 --oltp-table-size=500000 \
--report-interval=10 --rand-init=on --max-requests=0 \
--oltp-read-only=off --max-time=120 --num-threads=30 \
prepare
Creating table 'sbtest1'...
Inserting 100000 records into 'sbtest1'
Creating secondary indexes on 'sbtest1'...
Creating table 'sbtest2'...
Inserting 100000 records into 'sbtest2'
Creating secondary indexes on 'sbtest2'...
......
Inserting 100000 records into 'sbtest9'
Creating secondary indexes on 'sbtest9'...
Creating table 'sbtest10'...
Inserting 100000 records into 'sbtest10'
Creating secondary indexes on 'sbtest10'...

5. 执行sysbench测试,并输出测试报告

#/home/mysql/sysbench-1.0/src/sysbench --test=/home/mysql/sysbench-1.0/tests/include/oltp_legacy/oltp.lua \
--mysql-host=mysql-host-ip --mysql-port=3306 --mysql-user=envision --mysql-password=password \
--mysql-db=dbtest --oltp-tables-count=10 --oltp-table-size=500000 \
--report-interval=10 --rand-init=on --max-requests=0 \
--oltp-read-only=off --max-time=120 --num-threads=128 \
run > /tmp/liang/mysql-report.txt

6. 查看测试报告

30个threads

sysbench 1.0.12 (using bundled LuaJIT 2.1.0-beta2)
Running the test with following options:
Number of threads: 30
Report intermediate results every 10 second(s)
Initializing random number generator from current time
Initializing worker threads...
Threads started!
[ 10s ] thds: 30 tps: 188.63 qps: 3795.16 (r/w/o: 2659.89/755.31/379.96) lat (ms,95%): 223.34 err/s: 0.00 reconn/s: 0.00
[ 20s ] thds: 30 tps: 177.80 qps: 3563.97 (r/w/o: 2496.95/711.31/355.71) lat (ms,95%): 248.83 err/s: 0.00 reconn/s: 0.00
[ 30s ] thds: 30 tps: 177.20 qps: 3542.62 (r/w/o: 2479.82/708.30/354.50) lat (ms,95%): 235.74 err/s: 0.00 reconn/s: 0.00
[ 40s ] thds: 30 tps: 189.60 qps: 3797.38 (r/w/o: 2658.99/759.20/379.20) lat (ms,95%): 227.40 err/s: 0.00 reconn/s: 0.00
[ 50s ] thds: 30 tps: 190.40 qps: 3798.09 (r/w/o: 2655.29/762.20/380.60) lat (ms,95%): 211.60 err/s: 0.00 reconn/s: 0.00
[ 60s ] thds: 30 tps: 179.70 qps: 3598.40 (r/w/o: 2520.50/718.40/359.50) lat (ms,95%): 235.74 err/s: 0.00 reconn/s: 0.00
[ 70s ] thds: 30 tps: 187.30 qps: 3740.91 (r/w/o: 2617.61/748.50/374.80) lat (ms,95%): 227.40 err/s: 0.00 reconn/s: 0.00
[ 80s ] thds: 30 tps: 187.40 qps: 3755.29 (r/w/o: 2630.19/750.40/374.70) lat (ms,95%): 211.60 err/s: 0.00 reconn/s: 0.00
[ 90s ] thds: 30 tps: 188.10 qps: 3762.11 (r/w/o: 2632.80/753.10/376.20) lat (ms,95%): 211.60 err/s: 0.00 reconn/s: 0.00
[ 100s ] thds: 30 tps: 183.70 qps: 3676.35 (r/w/o: 2575.16/733.69/367.49) lat (ms,95%): 227.40 err/s: 0.00 reconn/s: 0.00
[ 110s ] thds: 30 tps: 190.80 qps: 3816.33 (r/w/o: 2671.42/763.41/381.50) lat (ms,95%): 211.60 err/s: 0.00 reconn/s: 0.00
[ 120s ] thds: 30 tps: 195.49 qps: 3907.36 (r/w/o: 2733.40/783.17/390.79) lat (ms,95%): 204.11 err/s: 0.00 reconn/s: 0.00
SQL statistics:
    queries performed:
        read:                            313488 --读总数
        write:                          89568  --写总数
        other:                          44784 --其他操作(CURD之外的操作,例如COMMIT)
        total:                          447840 --全部总数
    transactions:                        22392  (186.27 per sec.) --总事务数(每秒事务数)
    queries:                            447840 (3725.43 per sec.) --总数(每秒总数)
    ignored errors:                      0      (0.00 per sec.)  --总忽略错误总数(每秒忽略错误次数)
    reconnects:                          0      (0.00 per sec.) --重连总数(每秒重连次数)
General statistics:
    total time:                          120.2098s --总耗时
    total number of events:              22392 --共发生多少事务数
Latency (ms):
        min:                                  105.91 --最小耗时
        avg:                                  160.86 --平均耗时
        max:                                  850.77 --最长耗时
        95th percentile:                      223.34 --超过95%平均耗时
        sum:                              3601892.56
Threads fairness:
    events (avg/stddev):          746.4000/4.95 --总处理事件数/标准偏差
    execution time (avg/stddev):  120.0631/0.05--总执行时间/标准偏差

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/9dc738118d5a914da54371eeda19860e.html