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
 
(3 intermediate revisions by one other user not shown)
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>
<syntaxhighlight lang="bash">
 
#!/bin/bash
#!/bin/bash


Line 23: Line 24:
rm some_random_file_
rm some_random_file_
rm $2
rm $2
</pre>
</syntaxhighlight>


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 34:
to create a 500MB file.
to create a 500MB file.


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


Start the script like this:
The result will be something like  
  ./speed_test.sh /mnt/sda1/zerofile /mnt/sdb1/zerofilecopy 3
  ./speed_test.sh ./zerofile ./2delete 5
237 MB/s

Latest revision as of 16:36, 11 August 2015

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

<syntaxhighlight lang="bash">

  1. !/bin/bash
  1. USAGE:
  2. ./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

  1. clean up

rm some_random_file_ rm $2 </syntaxhighlight>

  • 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

The result will be something like

./speed_test.sh ./zerofile ./2delete 5
237 MB/s