sysbench安装与使用

sysben笔记;
1、安装:
参考url:https://github.com/akopytov/sysbench#general-syntax
RHEL / CentOS的:
curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.rpm.sh | sudo bash
sudo yum -y install sysbench

2、常规通用参数:
https://github.com/akopytov/sysbench#general-syntax 登录后通过chrome浏览器翻译后查看。
--threads    要创建的工作线程总数
--time    限制总执行时间(以秒为单位)。0表示没有限制
。。。。。。

3、命令结构:
sysbench [options]... [testname] [command]
[options]:通用参数,如--threads=16 --time=20
[testname]:要测试的模块或脚本。fileio,cpu,/usr/share/sysbench/oltp_write_only.lua等。脚本查看方式:shell> ls /usr/share/sysbench/
[command]:具体命令。prepare run cleanup  help 。prepare:准备主句。run:执行。cleanup:清空测试数据。help:testname或脚本的帮助。


测试准备脚本:
1、手动创建sbtest数据库并付权。
2、查看目标脚本参数:shell> sysbench /usr/share/sysbench/oltp_write_only.lua help #查看脚本需要的特殊参数。
3、准备数据。
sysbench --time=20  --threads=32 --mysql-host=112.35.98.127 --mysql-port=3306 --mysql-user=root --mysql-password=xxxxxx  /usr/share/sysbench/oltp_write_only.lua   prepare
4、执行测试
sysbench --time=20  --threads=32 --mysql-host=112.35.98.127 --mysql-port=3306 --mysql-user=root --mysql-password=xxxxxx  /usr/share/sysbench/oltp_write_only.lua   run
5、清除测试数据
sysbench --time=20  --threads=32 --mysql-host=112.35.98.127 --mysql-port=3306 --mysql-user=root --mysql-password=xxxxxx  /usr/share/sysbench/oltp_write_only.lua   cleanup

参考链接:

https://blog.csdn.net/oahz4699092zhao/article/details/53332105

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值