Skip to content

Instantly share code, notes, and snippets.

@concubidated
Created October 31, 2012 00:46
Show Gist options
  • Save concubidated/3984115 to your computer and use it in GitHub Desktop.
Save concubidated/3984115 to your computer and use it in GitHub Desktop.
#!/bin/bash
usage()
{
echo "Usage: $0: [OPTIONS]"
echo " -d : Path to OSD data directory"
echo " -j : Path to journal"
echo "Example:"
echo " $0 -d /src/ceph-osd.1/test/ -j /dev/sdi"
exit 1
}
while getopts 'd:j:' option
do
case $option in
d)
DATA="${OPTARG}"
;;
j)
JOURNAL="${OPTARG}"
;;
esac
done
if [ ! $DATA ] || [ ! $JOURNAL ]; then
usage
fi
IO_SIZE='4096 131072 4194304'
RESULTS="smallio_results"
#Create test directory
mkdir $DATA
mkdir $RESULTS
#Launch process to drop caches ans save PID
while true; do echo 1 > /proc/sys/vm/drop_caches; sleep 1; done &
PID=$!
#Loop through IO sizes
for size in $IO_SIZE
do
#loop for read and write
for ratio in 0 1
do
if [ $ratio == 0 ]
then
rw="read"
else
rw="write"
fi
echo "Deleteing old test data"
rm -r $DATA/*
#echo "./smalliobenchfs --num-concurrent-ops 16 --io-size $size --object-size 4194304 --filestore-path $DATA --journal-path $JOURNAL --disable-detailed-ops=1 --duration=300 --filestore-op-threads=10 --write-ratio=${ratio} --num-objects=500 >> $RESULTS/smallio_${rw}_${size}.log"
./smalliobenchfs --num-concurrent-ops 16 --io-size $size --object-size 4194304 --filestore-path $DATA --journal-path $JOURNAL --disable-detailed-ops=1 --duration=300 --filestore-op-threads=10 --write-ratio=${ratio} --num-objects=500 >> $RESULTS/smallio_${rw}_${size}.log
sleep 10
done
done
#Kill the cache killer
kill $PID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment