Perform bechmarks on the filesystem: Difference between revisions
Appearance
No edit summary |
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: | ||
< | <syntaxhighlight lang="bash"> | ||
#!/bin/bash | #!/bin/bash | ||
Line 23: | Line 24: | ||
rm some_random_file_ | rm some_random_file_ | ||
rm $2 | rm $2 | ||
</ | </syntaxhighlight> | ||
*To make a big file, use | *To make a big file, use |
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">
- !/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 </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