Sysbench 0.5 安装与使用

1. 下载 Sysbench 0.5

     sysbench-0.5.tar.gz

 

2. 解压

     tar zxf sysbench-0.5.tar.gz

 

3. 安装

    [root@test2 sysbench-0.5]# ./autogen.sh

    automake 1.10.x (aclocal) wasn't found, exiting

    [root@test2 sysbench-0.5]# yum install automake -y

    [root@test2 sysbench-0.5]# ./autogen.sh

    libtoolize 1.4+ wasn't found, exiting

    [root@test2 sysbench-0.5]# yum install -y libtool

    [root@test2 sysbench-0.5]# ./autogen.sh

 

    PS:如果没有出现上面红色错误,则执行 ./autogen.sh 这个即可。

 

    [root@test2 sysbench-0.5]# ./configure

    [root@test2 sysbench-0.5]# make & make install

    [root@test2 sysbench-0.5]# sysbench --version

    sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

    [root@test2 sysbench-0.5]# export LD_LIBRARY_PATH=/usr/local/mysql/lib

 

4.测试

    创建测试文件存放目录,并 cd 进去

 

    生成测试文件:

    [root@test2 sysbench_test]#sysbench --test=fileio --file-num=4 --file-block-size=8192 --file-total-size=10G --file-test-mode=rndrd --file-extra-flags=direct prepare

--test:测试类型,fileio 表示进行 IO 测试;

--file-num:生成的文件数量;

--file-block-size:文件块大小;

--file-total-size:文件总大小;

--file-test-mode:读取规则,rndrd表示随机读;

--file-extra-flags:测试模式;

prepare:生成测试文件;

 

    性能测试:

    [root@test2 sysbench_test]#sysbench --test=fileio --file-num=4 --file-block-size=8192 --file-total-size=10G --file-test-mode=rndrd --file-extra-flags=direct --max-requests=0 --max-time=30 --num-threads=16 --report-interval=3 run

--max-requests:最大请求数量,0表示不限制;

--max-time:测试时间,单位s;

--num-threads:线程数;

--report-interval:每个几秒在打印一次报告、

run:运行测试;

sysbench 0.5: multi-threaded system evaluation benchmark

Running the test with following options:

Number of threads: 16

Report intermediate results every 3 second(s)

Random number generator seed is 0 and will be ignored

Threads started!

[ 3s] reads: 105.26 MB/s writes: 0.00 MB/s fsyncs: 0.00/s

[ 6s] reads: 105.19 MB/s writes: 0.00 MB/s fsyncs: 0.00/s

[ 9s] reads: 108.34 MB/s writes: 0.00 MB/s fsyncs: 0.00/s

[ 12s] reads: 117.87 MB/s writes: 0.00 MB/s fsyncs: 0.00/s

[ 15s] reads: 114.39 MB/s writes: 0.00 MB/s fsyncs: 0.00/s

[ 18s] reads: 96.25 MB/s writes: 0.00 MB/s fsyncs: 0.00/s

[ 21s] reads: 108.00 MB/s writes: 0.00 MB/s fsyncs: 0.00/s

[ 24s] reads: 114.03 MB/s writes: 0.00 MB/s fsyncs: 0.00/s

[ 27s] reads: 116.36 MB/s writes: 0.00 MB/s fsyncs: 0.00/s

Operations performed: 419156 reads, 0 writes, 0 Other = 419156 Total

Read 3.1979Gb Written 0b Total transferred 3.1979Gb (109.15Mb/sec)

13971.13 Requests/sec executed 这里就是IOPS(随机读的IOPS)

Test execution summary:

total time: 30.0016s

total number of events: 419156

total time taken by event execution: 470.5694s

per-request statistics:

min: 0.09ms

avg: 1.12ms

max: 46.10ms

approx. 95 percentile: 3.29ms

Threads fairness:

events (avg/stddev): 26197.2500/254.38

execution time (avg/stddev): 29.4106/0.06

 

清理测试文件:

[root@test2 sysbench_test]# sysbench --test=fileio --file-num=4 --file-block-size=8192 --file-total-size=1G --file-test-mode=rndrd --file-extra-flags=direct --max-requests=0 --max-time=30 --num-threads=16 --report-interval=3 cleanup

 

 

技术交流群:586892817

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Ty_FFTQ

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值