Perform bechmarks on the filesystem: Difference between revisions

From www.ReeltoReel.nl Wiki
Jump to navigation Jump to search
(Created page with "To test the speed of the filesystem (not the physical disk!) you can use the following script: <pre> #!/bin/bash # USAGE: # ./speed_test.sh /path/to/my/file /path/to/destinat...")
 
No edit summary
Line 1: Line 1:
To test the speed of the filesystem (not the physical disk!) you can use the following script:
*To test the speed of the filesystem (not the physical disk!) you can use the following script:
<pre>
<pre>
#!/bin/bash
#!/bin/bash
Line 25: Line 25:
</pre>
</pre>


to make a big file, use  
*To make a big file, use  
  cat /dev/zero > zerofile
  cat /dev/zero > zerofile
and abort it with CTRL-C after a few seconds.  
and abort it with CTRL-C after a few seconds.  
Line 33: Line 33:
to create a 500MB file.
to create a 500MB file.


 
*Start the script like this:  
Start the script like this:  
  ./speed_test.sh /mnt/sda1/zerofile /mnt/sdb1/zerofilecopy 3
  ./speed_test.sh /mnt/sda1/zerofile /mnt/sdb1/zerofilecopy 3

Revision as of 19:49, 31 January 2012

  • To test the speed of the filesystem (not the physical disk!) you can use the following script:
#!/bin/bash

# USAGE:
# ./speed_test.sh /path/to/my/file /path/to/destination number_of_tests

NUM_TESTs=$3
SUM=0
for i in $( seq 1 $NUM_TESTs ); do

REC=`dd if=$1 of=$2 2> some_random_file_ ; cat some_random_file_ | cut -d " " -f8 | tail -1`

SUM=`echo $SUM + $REC | bc`

done

RESULT=`echo $SUM / $NUM_TESTs | bc |  awk '{ str1=str1 $0 }END{ print str1 }'`

echo $RESULT MB/s

#clean up
rm some_random_file_
rm $2
  • To make a big file, use
cat /dev/zero > zerofile

and abort it with CTRL-C after a few seconds.

Alternatively, you can use something like

dd if=/dev/zero of=file.out bs=1MB count=500

to create a 500MB file.

  • Start the script like this:
./speed_test.sh /mnt/sda1/zerofile /mnt/sdb1/zerofilecopy 3