Skip to content

Instantly share code, notes, and snippets.

@concubidated
Created February 7, 2013 21:06
Show Gist options
  • Save concubidated/4734166 to your computer and use it in GitHub Desktop.
Save concubidated/4734166 to your computer and use it in GitHub Desktop.
Rados Bench
#!/bin/bash
num_instances=4
hosts=("ceph0" "ceph1")
let num_pools=${#hosts[@]}*$num_instances
#Create Pools
pgs=16384
for i in $(seq 1 $num_pools)
do
ceph osd pool create performance_${i} $pgs $pgs
ceph osd pool set performance_${i} size 1
done
#Begins Test
sizes="4096 131072 4194304"
for size in $sizes
do
#Write Test
i=1
for host in ${hosts[@]}
do
let k=$i+$num_instances-1
for n in $(seq $i $k)
do
ssh $host rados bench 300 write -p performance_${n} -b ${size} --no-cleanup > rados_write_${size}_${host}_${n} &
done
let i=$k+1
echo $host: write test ${size} running...
done
wait
#Read Test
i=1
for host in ${hosts[@]}
do
let k=$i+$num_instances-1
for n in $(seq $i $k)
do
ssh $host rados bench 120 seq -p performance_${n} -b ${size} --no-cleanup > rados_read_${size}_${host}_${n} &
done
let i=$k+1
echo $host: read test size ${size} running...
done
wait
done
echo "Test done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment