首页 > 代码库 > Linux下磁盘IO读写性能测试脚本
Linux下磁盘IO读写性能测试脚本
#!/bin/sh #author:reed #blog:luweikai.blog.51cto.com #说明:使用自带的dd命令 file=dd.file BS_COUNT_8K=(8K 12K) BS_COUNT_64K=(64K 6K) BS_COUNT_1M=(1M 1K) list="8K 64K 1M" wlog=/tmp/ddwrite.log rlog=/tmp/ddread.log #write Write() { echo "[INFO]WRITE" for i in $list;do bs=$(eval echo \$\{BS_COUNT_$i\[0\]\}) count=$(eval echo \$\{BS_COUNT_$i\[1\]\}) echo "dd if=/dev/zero of=$file conv=fsync oflag=direct bs=$bs count=$count" dd if=/dev/zero of=$file conv=fsync oflag=direct bs=$bs count=$count 2>>$wlog echo " " #echo "sleep 3" sleep 3 done } #read Read() { echo "[INFO]READ" for i in $list;do bs=$(eval echo \$\{BS_COUNT_$i\[0\]\}) count=$(eval echo \$\{BS_COUNT_$i\[1\]\}) echo "dd if=$file of=/dev/null iflag=direct bs=$bs count=$count" dd if=$file of=/dev/null iflag=direct bs=$bs count=$count 2>> $rlog echo " " #echo "sleep 3" sleep 3 done } Write|tee -a $wlog echo "please wait 5 seconds......" sleep 5 Read|tee -a $rlog
本文出自 “[reed@卢伟开~]#rm -rf /” 博客,请务必保留此出处http://luweikai.blog.51cto.com/1705672/1547114
Linux下磁盘IO读写性能测试脚本
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。