Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Filesystems, Performance

Filesystem Performance Testing Using dd

Submitted by on February 5, 2013 – 3:35 pm 5 Comments

Below is a simple script to test filesystem read/write performance using dd with varying blocksize parameter. This can be useful for testing local filesystems as well as network-mounted filesystems. The end result will be a CSV file that can be opened and graphed using your favorite spreadsheet application.


#!/bin/ksh
# krazyworks.com
# Run filesystem performance test using dd with varying block size parameter
#

if [ ! $1 ] || [ ! $2 ] ; then echo "Usage: ddtest [filesize in GB] [target directory]" ; exit 1 ; fi
filesize=$1 ; target1=$2 ; target=$(echo "${target1}" | sed 's@/$@@g')

if [ ! -d "${target}" ] ; then echo "Usage: ddtest [filesize in GB] [target directory]" ; exit 1 ; fi
if [ ! -w "${target}" ] ; then echo "Directory ${target} is not writable by `/usr/bin/whoami`" ; exit 1 ; fi

outfile="/tmp/ddtest_`hostname -s`_`date +'%Y-%m-%d_%H%M%S'`.csv"
if [ -f "${outfile}" ] ; then /bin/rm -f "${outfile}" ; fi

mountpoint=$(df -hP "${target}" | grep -v ^Filesystem | awk '{print $1}')
host=$(hostname -s)

cat << EOF
${host}
`date +'%Y-%m-%d %H:%M%'`
---------------------------------------------------------------------
Testing ${target} mounted on ${mountpoint}

EOF

echo "Date,Host,Run,Direction,Rate,Unit,Filesize (Bytes),Blocks,Block Size (Bytes),Target,Mountpoint" | tee -a "${outfile}"

filesize_b=$(echo "scale=0;${filesize}*1024*1024*1024"|bc -l)

for blocksize in 1048576 2097152 4194304 8388608 16777216
do
	for i in `seq 1 5`
	do
		timestamp=$(date +'%Y-%m-%d %H:%M:%S')
		blockcount=$(echo "scale=0;${filesize_b}/${blocksize}"|bc -l)
		line=$(dd if=/dev/zero bs=${blocksize} count=${blockcount} of=${target}/ddtest_${host}.tmp 2>&1)
		speed=$(echo "${line}" | grep "/" | awk '{print $8","$9}')
		echo "${timestamp},${host},${i},up,${speed},${filesize_b},${blockcount},${blocksize},${target},${mountpoint}" | tee -a "${outfile}"
		if [ -f /tmp/ddtest_${host}.tmp ] ; then /bin/rm -f /tmp/ddtest_${host}.tmp ; fi
		timestamp=$(date +'%Y-%m-%d %H:%M:%S')
		line=$(dd if=${target}/ddtest_${host}.tmp bs=${blocksize} count=${blockcount} of=/tmp/ddtest_${host}.tmp 2>&1)
		speed=$(echo "${line}" | grep "/" | awk '{print $8","$9}')
		echo "${timestamp},${host},${i},down,${speed},${filesize_b},${blockcount},${blocksize},${target},${mountpoint}" | tee -a "${outfile}"
	done
done

 

Print Friendly, PDF & Email

5 Comments »

  • kerrin marz says:

    Obviously I’m a 34 DD and I’m active in a lot of sports. I always have problems with finding the right sports bra. The ones I’m currently wearing are Champion ones that are meant for big boobs, but they always stretch out and don’t give me full coverage. I was wondering if Under Armour ones were better or any other brand. Thanks.

  • Gamer959 says:

    What I am asking is have you not recieved a confirmation email from the irs and just the dd date from WMR also has anyone received a refund without a confirmation email or WMR?

  • Hotshot t says:

    Tax refund has been approved and dd date that has been given is Feb 21st. Has anyone gotten it earlier?

  • David says:

    I filed and on 1/30 and was accepted early morning 1/31. Early this morning I was able to order a return transcript. Does this mean I should receive a DD date soon? Has anybody else done the same and received a DD date?

  • simply complicated says:

    I know this question has been asked, but I am going crazy getting 2 different answers. I saw one post that someone DID receive theirs by DD and had their fees taken out of their refund. Can ANYONE confirm that they have received theirs by DD yet? My second question is, are the paper checks being mailed out yet? I also came across some posts that some were already being mailed now.

Leave a Reply

%d bloggers like this: