设为首页 加入收藏

TOP

sysbench对数据库进行压力测试(三)
2017-04-21 10:22:57 】 浏览:738
Tags:sysbench 数据库 进行 压力 测试
nbsp;       sum:                              99785.92
 
Threads fairness:
    events (avg/stddev):          128727.0000/0.00
    execution time (avg/stddev):  99.7859/0.00


清除测试数据:
sysbench fileio --file-total-size=40G cleanup


OLTP基准测试
OLTP基准测试模拟了一个简单的事务处理系统的工作负载。若要对数据库性能进行测试就要使用OLTP相关的脚本。
在/usr/share/sysbench/目录下有相关的lua脚本:


bulk_insert.lua
oltp_common.lua
oltp_delete.lua
oltp_insert.lua
oltp_point_select.lua
oltp_read_only.lua
oltp_read_write.lua
oltp_update_index.lua
oltp_update_non_index.lua
oltp_write_only.lua
select_random_points.lua
select_random_ranges.lua


对于未知的测试参数,可以通过 sysbench  scripts-name help 来查看。


创建测试数据:
sysbench oltp_common  --table-size=1000000 --db-driver=mysql \
--mysql-db=test --mysql-user=root --mysql-password=123456  prepare


Creating table 'sbtest1'...
Inserting 1000000 records into 'sbtest1'
Creating a secondary index on 'sbtest1'...


执行run命令进行测试:(只读)
sysbench oltp_read_only  --table-size=1000000 --db-driver=mysql \
 --mysql-db=test --mysql-user=root --mysql-password=123456 --time=60  --max-requests=0 --threads=8 run
#测试结果
 
Running the test with following options:
Number of threads: 8
Initializing random number generator from current time
Initializing worker threads...
Threads started!
SQL statistics:
    queries performed:
        read:                            1679174
        write:                          0
        other:                          239882
        total:                          1919056
    transactions:                        119941 (1998.81 per sec.)
    queries:                            1919056 (31980.95 per sec.)
    ignored errors:                      0      (0.00 per sec.)
    reconnects:                          0      (0.00 per sec.)
General statistics:
    total time:                          60.0047s
    total number of events:              119941
Latency (ms):
        min:                                  0.32
        avg:                                  4.00
        max:                                56.17
        95th percentile:                   

首页 上一页 1 2 3 4 下一页 尾页 3/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇MySQL同实例下复制表的2种方法 下一篇CentOS7.2下安装MySQL

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目