Open main menu

CDOT Wiki β

Changes

Winter 2009 SYA810 Block Device Benchmark Scripts

873 bytes added, 02:49, 2 February 2009
Joy Black (example)
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.
= Joy Black (example) P. Constantino =
Script or link #!/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 script goes hereprocess randomly $BLOCKS blocks of 1KB on /dev/$BLOCKDEVICE."
= Gregory Masseau =