Stupid Unix Storage performance script

Here it is , stupid but works to compare 2 different storage (or mount points).

#!/bin/bash
#--- Test the write speed
count=0
count2=0
echo Machine is $HOSTANME > result.txt
 
openssl rand -out 1Meg 1048576
echo "1 Mb write and delete" >> result.txt
 
while [ $count2 -lt 6 ];do
START=`date +%s`
# echo "Script start time (Unix epoch): $START"
#
count=0
while [ $count -lt 1024 ]; do
  cp 1Meg 1Meg.cp
  rm 1Meg.cp
  let count=count+1
done
#
FINISH=`date +%s`
# echo "Script finish time (Unix epoch): $FINISH"
#
ELAPSED=`expr $FINISH - $START`
echo "Elapsed time: $ELAPSED"
echo $ELAPSED >> result.txt
let count2=count2+1
done
more result.txt

Be the first to comment

Leave a Reply

Your email address will not be published.


*


*