设为首页 加入收藏

TOP

数据库优化-基准测试(四)(三)
2015-11-21 01:36:33 来源: 作者: 【 】 浏览:6
Tags:数据库 优化 基准 测试
s: events (avg/stddev): 625.0000/10.07 execution time (avg/stddev): 12.7951/0.01

例子3:更复杂的测试

#--oltp-point-selects:在一个事务里面Point select的数量,默认为10
#--oltp-range-size:range查询的范围大小,默认100,应该小于oltp-table-size
#--oltp-index-updates:在单个事务中index update的数量,默认1
#--max-time:限制最大的整体执行时间(秒)
$ sysbench --test=sysbench/sysbench/sysbench/tests/db/oltp.lua --oltp-tables-count=4 --oltp-table-size=500000 --oltp-test-mode=complex ?mysql-user=root --mysql-password=password --num-threads=16 --oltp-point-selects=1000 --oltp-range-size=1000 --oltp-index-updates=1000 --max-time=300 run
Number of threads: 16
OLTP test statistics:
queries performed:
read: 5803120
write: 2015732
other: 7585
total: 7826437
transactions: 1805 (5.98 per sec.)
deadlocks: 3975 (13.18 per sec.)
read/write requests: 7818852 (25916.23 per sec.)
other operations: 7585 (25.14 per sec.)
General statistics:
total time: 301.6972s
total number of events: 1805
total time taken by event execution: 4815.5190s
response time:
min: 383.54ms
avg: 2667.88ms
max: 18964.65ms
approx. 95 percentile: 6059.93ms
Threads fairness:
events (avg/stddev): 112.8125/6.89
execution time (avg/stddev): 300.9699/0.48

查询的类型

单记录查询
SELECT c FROM sbtest WHERE id=N 索引列UPDATE
UPDATE sbtest SET k=k+1 WHERE id=N 非索引列UPDATE
UPDATE sbtest SET c=N WHERE id=M 范围查询
SELECT c FROM sbtest WHERE id BETWEEN N AND M SUM()范围查询
SELECT SUM(k) FROM sbtest WHERE id between N and M ORDER BY范围查询
SELECT c FROM sbtest WHERE id between N and M ORDER BY c DISTINCT范围查询
SELECT DISTINCT c FROM sbtest WHERE id BETWEEN N and M
ORDER BY c
首页 上一页 1 2 3 4 下一页 尾页 3/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Redis学习笔记---字符串类型 下一篇MongoDB的master-slave及replset..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: