2015-10-16

[SOLVED]dd-benchmark-tool

#10:48 25/09/2015
#/opt/script/dd-benchmark-tool.sh
#################################
#Source: http://neo4j.com/docs/stable/linux-performance-guide.html#_file_system_benchmark

now="$(date +'%Y.%m.%d-%H.%M.%S.%3N')"
now1="$(date +'%Y.%m.%d-%H.%M.%S.%3N')"
start_ts="$(date +'%s%3N')"
#############COMMAND:BEGIN
rm -rf *.bmrk

#LOCATION WANT TO TEST IO:
#cd /data

echo "###########################################################" > benchmark-result-$now.bmrk 2>&1
echo "1" >> benchmark-result-$now.bmrk 2>&1
dd if=/dev/urandom of=store.data bs=1M count=1000                 >> benchmark-result-$now.bmrk 2>&1

echo "" >> benchmark-result-$now.bmrk 2>&1
echo "2" >> benchmark-result-$now.bmrk 2>&1
dd if=store.data of=/dev/null bs=100M >> benchmark-result-$now.bmrk 2>&1

echo "" >> benchmark-result-$now.bmrk 2>&1
echo "3" >> benchmark-result-$now.bmrk 2>&1
dd if=store.data of=/dev/null bs=100M >> benchmark-result-$now.bmrk 2>&1

echo "" >> benchmark-result-$now.bmrk 2>&1
echo "4" >> benchmark-result-$now.bmrk 2>&1
dd if=store.data of=/dev/null bs=100M >> benchmark-result-$now.bmrk 2>&1

echo "" >> benchmark-result-$now.bmrk 2>&1
ls -lh store.data >> benchmark-result-$now.bmrk 2>&1
rm -rf store.data >> benchmark-result-$now.bmrk 2>&1
#############COMMAND:END
now2="$(date +'%Y.%m.%d-%H.%M.%S.%3N')"
stop_ts="$(date +'%s%3N')"
DIFF=$((stop_ts-start_ts))
hour=$((DIFF/(60*60*1000)))
 min=$((DIFF/(60*1000)))
 sec=$(((DIFF%(60*1000))/1000))
  ms=$(((DIFF%(60*1000))%1000))
echo "####################################">> benchmark-result-$now.bmrk 2>&1
echo "**RUNTIME**|[""${hour}:${min}:${sec}.$ms""](h:m:s:msec)">> benchmark-result-$now.bmrk 2>&1
echo "STARTING...|"$now1>> benchmark-result-$now.bmrk 2>&1
echo "...... DONE|"$now2>> benchmark-result-$now.bmrk 2>&1
echo "####################################">> benchmark-result-$now.bmrk 2>&1
#
#RESULT:
# root@srv011:/tmp# cat benchmark-result-2015.09.25-14.08.01.327.bmrk
# ###########################################################
# 1
# 1000+0 records in
# 1000+0 records out
# 1048576000 bytes (1.0 GB) copied, 85.87 s, 12.2 MB/s

# 2
# 10+0 records in
# 10+0 records out
# 1048576000 bytes (1.0 GB) copied, 0.196152 s, 5.3 GB/s

# 3
# 10+0 records in
# 10+0 records out
# 1048576000 bytes (1.0 GB) copied, 0.179133 s, 5.9 GB/s

# 4
# 10+0 records in
# 10+0 records out
# 1048576000 bytes (1.0 GB) copied, 0.18271 s, 5.7 GB/s

# -rw-r--r-- 1 root root 1000M Sep 25 14:09 store.data
# ####################################
# **RUNTIME**|[0:1:26.501](h:m:s:msec)
# STARTING...|2015.09.25-14.08.01.327
# ...... DONE|2015.09.25-14.09.27.828
# ####################################
# root@srv011:/tmp#

No comments:

Post a Comment