【tool】sysbench IO压测

sysbench 1.0 安装

下载

https://github.com/akopytov/sysbench/tree/1.0

解压

unzip sysbench-1.0.zip

安装依赖

yum -y install  make automake libtool pkgconfig libaio-devel vim-common

编译安装(不安装mysql支持,若安装mysql支持,需要指定mysql-include和mysql-lib路径)

./autogen.sh

./configure --prefix=/home/bkadmin/software/sysbench --without-mysql

make

make install

安装完成

正常可以直接拷贝到其他机器使用,无需重复编译安装。

压测基础IO

并发线程数16个,总数据量60G

sysbench --threads=16 --test=fileio --file-total-size=60G --file-test-mode=rndrw prepare

进行fileio(rndrw随机读写)测试
sysbench fileio --time=180 --events=100000000 --threads=16 --file-total-size=60G --file-test-mode=rndrw --file-num=128 --file-extra-flags=direct  --file-block-size=16384 --report-interval=10 run

进行fileio(rndwr随机写)测试

sysbench fileio --time=180 --events=100000000 --threads=16 --file-total-size=60G --file-test-mode=rndwr --file-num=128 --file-extra-flags=direct  --file-block-size=16384 --report-interval=10 run

进行fileio(rndrd随机读)测试
sysbench fileio --time=180 --events=100000000 --threads=16 --file-total-size=60G --file-test-mode=rndrd --file-num=128 --file-extra-flags=direct  --file-block-size=16384 --report-interval=10 run

清除生成的数据
sysbench --threads=16 --test=fileio --file-total-size=60G --file-test-mode=rndrw cleanup

sysbench fileio帮助

./sysbench fileio help
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

fileio options:
--file-num=N number of files to create [128]
--file-block-size=N block size to use in all IO operations [16384]
--file-total-size=SIZE total size of files to create [2G]
--file-test-mode=STRING test mode {seqwr, seqrewr, seqrd, rndrd, rndwr, rndrw}
--file-io-mode=STRING file operations mode {sync,async,mmap} [sync]
--file-async-backlog=N number of asynchronous operatons to queue per thread [128]
--file-extra-flags=[LIST,...] list of additional flags to use to open files {sync,dsync,direct} []
--file-fsync-freq=N do fsync() after this number of requests (0 - don't use fsync()) [100]
--file-fsync-all[=on|off] do fsync() after each write operation [off]
--file-fsync-end[=on|off] do fsync() at the end of test [on]
--file-fsync-mode=STRING which method to use for synchronization {fsync, fdatasync} [fsync]
--file-merged-requests=N merge at most this number of IO requests if possible (0 - don't merge) [0]
--file-rw-ratio=N reads/writes ratio for combined test [1.5]

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值