dd를 이용한 Disk IO 성능 측정
아래와 같은 스크립트로 성능 측정
자세한 설명은 추후 업데이트 예정
#!/bin/sh
i=0
# test iteration
LOOP=10
# 1G = 51200k * 20
# 1G = 1024k * 1024
BLOCK_SIZE=51200k
COUNT=20
while [ $i -lt $LOOP ]
do
#### initialization ##################################################################
i=`expr $i + 1`
echo "== $i iteration =="
# flush file system buffer
sync
#### write test ##################################################################
# To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
# cond=fsync: physically write output file data & metadata before finishing
dd if=/dev/zero of=1G_file_$i bs=$BLOCK_SIZE count=$COUNT conv=fsync 2>&1 | grep "MB"
#### read test ##################################################################
# To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
dd if=1G_file_$i of=/dev/zero bs=$BLOCK_SIZE 2>&1 | grep "MB"
#### delete test file ################################################################
rm 1G_file_$i
done
자세한 설명은 추후 업데이트 예정
#!/bin/sh
i=0
# test iteration
LOOP=10
# 1G = 51200k * 20
# 1G = 1024k * 1024
BLOCK_SIZE=51200k
COUNT=20
while [ $i -lt $LOOP ]
do
#### initialization ##################################################################
i=`expr $i + 1`
echo "== $i iteration =="
# flush file system buffer
sync
#### write test ##################################################################
# To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
# cond=fsync: physically write output file data & metadata before finishing
dd if=/dev/zero of=1G_file_$i bs=$BLOCK_SIZE count=$COUNT conv=fsync 2>&1 | grep "MB"
#### read test ##################################################################
# To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
dd if=1G_file_$i of=/dev/zero bs=$BLOCK_SIZE 2>&1 | grep "MB"
#### delete test file ################################################################
rm 1G_file_$i
done
댓글
댓글 쓰기