sysbenchmark常用测试笔记

一般在怀疑硬件问题或者做benchmark时可以使用该工具,此笔记用于benchmark0.5版本

IO测试

准备测试文件
sysbench --test=fileio --file-num=16 --file-total-size=2G prepare
执行IO测试
sysbench --test=fileio --file-total-size=2G --file-test-mode=rndrd --max-time=180 --max-requests=100000000 --num-threads=16 --init-rng=on --file-num=16 --file-extra-flags=direct --file-fsync-freq=0 --file-block-size=16384 run
关注点:
1、Total transferred 459.61Mb  (2.5522Mb/sec),正常值应50M以上
2、163.34 Requests/sec executed 随机读的IOPS。正常值4000以上


清理测试文件
sysbench --test=fileio --file-num=16 --file-total-size=2G cleanup


测试MYSQL OLTP
首先创建测试数据库,执行数据准备
sysbench --test=oltp --mysql-host=192.168.10.119 --mysql-port=3306 --mysql-user=root --mysql-password=123456 --mysql-db=sysbenchtest --oltp-tables-count=10 --oltp-table-size=6000000 --num-threads=50 --max-requests=100000000 --report-interval=1 --test=/tmp/sysbench-0.5/sysbench/tests/db/oltp.lua prepare
执行压测
sysbench --test=oltp --mysql-host=192.168.10.119 --oltp-test-mode=simeple --mysql-port=3306 --mysql-user=root --mysql-password=123456 --mysql-db=sysbenchtest --oltp-tables-count=10 --oltp-table-size=6000000 --num-threads=50 --max-requests=100000000 --report-interval=1 --max-time=20 --test=/tmp/sysbench-0.5/sysbench/tests/db/oltp.lua run
纯insert测试
sysbench --test=oltp --mysql-host=192.168.10.119 --mysql-port=3306 --mysql-user=root --mysql-password=123456 --mysql-db=sysbenchtest --oltp-tables-count=10 --oltp-table-size=600000 --num-threads=50 --max-requests=100000000 --report-interval=1 --max-time=20 --test=/tmp/sysbench-0.5/sysbench/tests/db/oltp.lua run


sysbench --test=oltp --mysql-table-engine=innodb --mysql-user=root --mysql-password=123456  --db-driver=mysql --oltp-nontrx-mode=update_key --mysql-db=sysbenchtest --oltp-table-size=600000 --oltp-table-name=sbtest10 --test=/tmp/sysbench-0.5/sysbench/tests/db/oltp.lua run


针对CPU进行测试
指定最大的素数
sysbench --test=cpu --cpu-max-prime=20000 run


cpu测试主要是寻找素数的方式


针对线程处理能力测试
sysbench --test=threads --num-threads=64 --thread-yields=100 --thread-locks=2 run


  --thread-yields=N      指定每个请求的压力,默认为1000
  --thread-locks=N       指定每个线程的锁数量,默认为8


互斥锁测试
sysbench --test=mutex --num-threads=16 \--mutex-num=1024 --mutex-locks=10000 --mutex-loops=5000 run
  --mutex-num=N    数组互斥的总大小。默认是4096
  --mutex-locks=N    每个线程互斥锁的数量。默认是50000
  --mutex-loops=N    内部互斥锁的空循环数量。默认是10000
  


内存测试
sysbench --test=memory --num-threads=512 --memory-block-size=262144 --memory-total-size=32G run

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值