#!/bin/sh#author:reed#blog:luweikai.blog.51cto.com# Description: Use the OWN DD command file=dd.filebs_count_8k= (8K 12K) BS_COUNT_ 64k= (64k 6k) bs_count_1m= (1m 1k) list= "8k 64k 1m" wlog=/tmp/ddwrite.logrlog=/tmp/ddread.log# Writewrite () { echo "[Info]write" for i in $list;d o 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} #readRead () { 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 $ wlogecho "Please wait 5 seconds ..." sleep 5read|tee -a $rlog
This article is from "[[email protected] Prof. Open ~] #rm-rf/" blog, please be sure to keep this source http://luweikai.blog.51cto.com/1705672/1547114
Disk IO read-write performance test script under Linux