Difference between revisions of "Winter 2009 SYA810 Block Device Benchmark Scripts"

From CDOT Wiki
Jump to: navigation, search
(Replacing page with 'Please post your block device benchmark script here. I'm looking for a wide range of benchmark methodologies, so your script should test in a different way than the other scrip...')
 
(10 intermediate revisions by 7 users not shown)
Line 1: Line 1:
Please post your block device benchmark script here. I'm looking for a wide range of benchmark methodologies, so your script should test in a different way than the other scripts. I will collect these scripts on '''Monday, Jan 26''' and create a master script which runs all of these tests and reports the overall results.
+
Please post your block device benchmark script here. I'm looking for a wide range of benchmark methodologies, so your script should test in a different way than the other scripts.
  
= John Doe (example) =
+
= P. Constantino =
  
  Script or link to script goes here
+
  #!/bin/bash
 +
# This script generate random numbers and seeks to that POSITION on the block device given, reading 1 kb of data at the time.
 +
# The purpose is test the speed of randomly reading 1024(default) blocks of 1KB from the disk.
 +
# A valid input for BLOCK DEVICE could be: /dev/sdb (disk) - /dev/sda9 (partition) - /dev/md8 (RAID) - /dev/mapper/foo/bar (LV).
 +
echo -n "Enter a number of block to read. Enter for default(1024): "
 +
read BLOCKS
 +
if [ "$BLOCKS" = "" ]
 +
then
 +
    BLOCKS=1024
 +
fi
 +
echo -n "Enter a valid block device (dev/): "
 +
read BLOCKDEVICE
 +
SIZE=$(df /dev/$BLOCKDEVICE | awk '{print $3}' | grep -v 'Used')
 +
time -p for ((x=1; x<=$BLOCKS; x++))
 +
do
 +
POSITION=$(( RANDOM % $SIZE + 1))
 +
dd if=/dev/$BLOCKDEVICE of=/dev/null bs=1k count=1 seek=$POSITION
 +
sync
 +
echo 3 >/proc/sys/vm/drop_caches
 +
done
 +
echo "  ^ time to process randomly $BLOCKS blocks of 1KB on /dev/$BLOCKDEVICE."
  
= Gregory Masseau =  
+
= Katherine Masseau =  
[http://matrix.senecac.on.ca/~gjmasseau/public_html/DiskTest.py Disk Test Script]
+
[http://matrix.senecac.on.ca/~gjmasseau/DiskTest.py Disk Test Script]
 +
 
 +
= Nestor CHAN =
 +
[http://matrix.senecac.on.ca/~tnchan/PerformanceTest/ Perfomance Test]
 +
 
 +
= Mohak Vyas =
 +
[http://zenit.senecac.on.ca/wiki/index.php/Performancescript Performance Test]
 +
 
 +
=Varinder Singh=
 +
[http://matrix.senecac.on.ca/~vsjhand/storage/python-scripts/ Python Performance Scripts]
 +
 
 +
Script in Python.Any suggestions would be welcome
 +
 
 +
 
 +
=Kezhong Liang=
 +
#!/bin/bash
 +
echo "Start to test ..."
 +
TIME_WRITE_START=$(date +%s)
 +
dd if=/dev/zero of=test bs=1024 count=1000000
 +
sync
 +
TIME_WRITE_END=$(date +%s)
 +
echo 3 > /proc/sys/vm/drop_caches
 +
sync
 +
TIME_READ_START=$(date +%s)
 +
dd if=test of=/dev/null bs=1024 count=1000000
 +
TIME_READ_END=$(date +%s)
 +
rm test
 +
echo "--------------------------------------------------------"
 +
TIME_WRITE_USED=$(($TIME_WRITE_END - $TIME_WRITE_START))
 +
echo -n "The write disk performance: "
 +
echo -n $((1024 / $TIME_WRITE_USED))
 +
echo " MB/sec"
 +
TIME_READ_USED=$(($TIME_READ_END - $TIME_READ_START))
 +
echo -n "The read disk performance: "
 +
echo -n $((1024 / $TIME_READ_USED))
 +
echo " MB/sec"
 +
 
 +
== Milton Paiva Neto ==
 +
 
 +
#!/bin/bash
 +
#
 +
# Script first written by Nestor Chan - Bossanesta and modified by Milton Paiva Neto <milton.paiva@gmail.com>
 +
# Create 10 files with one with 10 GBs fully of zeros
 +
 +
time -p (for ((x=1; x<=10; x++))
 +
do
 +
        dd if=/dev/zero of=fakefile$x bs=1G count=10;
 +
done
 +
sync
 +
)
 +
 
 +
= LINKS =
 +
[http://linux-raid.osdl.org/index.php/Performance Linux Raid Performance]

Latest revision as of 22:39, 16 July 2012

Please post your block device benchmark script here. I'm looking for a wide range of benchmark methodologies, so your script should test in a different way than the other scripts.

P. Constantino

#!/bin/bash
# This script generate random numbers and seeks to that POSITION on the block device given, reading 1 kb of data at the time. 
# The purpose is test the speed of randomly reading 1024(default) blocks of 1KB from the disk.
# A valid input for BLOCK DEVICE could be: /dev/sdb (disk) - /dev/sda9 (partition) - /dev/md8 (RAID) - /dev/mapper/foo/bar (LV).
echo -n "Enter a number of block to read. Enter for default(1024): "
read BLOCKS 
if [ "$BLOCKS" = "" ]
then
   BLOCKS=1024
fi
echo -n "Enter a valid block device (dev/): "
read BLOCKDEVICE
SIZE=$(df /dev/$BLOCKDEVICE | awk '{print $3}' | grep -v 'Used')
time -p for ((x=1; x<=$BLOCKS; x++))
	do 
		POSITION=$(( RANDOM % $SIZE + 1))
		dd if=/dev/$BLOCKDEVICE of=/dev/null bs=1k count=1 seek=$POSITION
		sync
		echo 3 >/proc/sys/vm/drop_caches
	done	
echo "  ^ time to process randomly $BLOCKS blocks of 1KB on /dev/$BLOCKDEVICE."

Katherine Masseau

Disk Test Script

Nestor CHAN

Perfomance Test

Mohak Vyas

Performance Test

Varinder Singh

Python Performance Scripts

Script in Python.Any suggestions would be welcome


Kezhong Liang

#!/bin/bash
echo "Start to test ..."
TIME_WRITE_START=$(date +%s)
dd if=/dev/zero of=test bs=1024 count=1000000
sync
TIME_WRITE_END=$(date +%s)
echo 3 > /proc/sys/vm/drop_caches
sync
TIME_READ_START=$(date +%s)
dd if=test of=/dev/null bs=1024 count=1000000
TIME_READ_END=$(date +%s)
rm test
echo "--------------------------------------------------------"
TIME_WRITE_USED=$(($TIME_WRITE_END - $TIME_WRITE_START))
echo -n "The write disk performance: "
echo -n $((1024 / $TIME_WRITE_USED))
echo " MB/sec"
TIME_READ_USED=$(($TIME_READ_END - $TIME_READ_START))
echo -n "The read disk performance: "
echo -n $((1024 / $TIME_READ_USED))
echo " MB/sec"

Milton Paiva Neto

#!/bin/bash
#
# Script first written by Nestor Chan - Bossanesta and modified by Milton Paiva Neto <milton.paiva@gmail.com>
# Create 10 files with one with 10 GBs fully of zeros

time -p (for ((x=1; x<=10; x++))
do
       dd if=/dev/zero of=fakefile$x bs=1G count=10; 
done
sync
)

LINKS

Linux Raid Performance