sysbench oltp_write_only --table-size=1000000 --db-driver=mysql \
--mysql-db=test --mysql-user=root --mysql-password=123456 --time=60 --max-requests=0 --threads=8 run
#测试结果
SQL statistics:
queries performed:
read: 0
write: 83764
other: 41882
total: 125646
transactions: 20941 (348.93 per sec.)
queries: 125646 (2093.56 per sec.)
ignored errors: 0 (0.00 per sec.)
reconnects: 0 (0.00 per sec.)
General statistics:
total time: 60.0120s
total number of events: 20941
Latency (ms):
min: 4.92
avg: 22.92
max: 5518.27
95th percentile: 69.29
sum: 479968.99
Threads fairness:
events (avg/stddev): 2617.6250/17.87
execution time (avg/stddev): 59.9961/0.00
上面的结果中包含了很多的信息,其中重点需要我们关注的信息是:
1、总的事务数 (total number of events)
2、每秒事务数
3、时间统计信息(最小,平均,最大响应时间,以及95%百分比响应时间)
4、线程公平性统计信息,表示负载的公平性。(thread-fairness)
清理测试数据:
sysbench oltp_read_only --table-size=1000000 --db-driver=mysql \
--mysql-db=test --mysql-user=root --mysql-password=123456 cleanup