52 lines
1.4 KiB
Text
52 lines
1.4 KiB
Text
|
#!/bin/bash
|
||
|
|
||
|
POOL=rbdbench
|
||
|
POOL_PG=4096
|
||
|
IMG_S=500G
|
||
|
R_T=60
|
||
|
TESTS="randwrite randread randrw"
|
||
|
OBJ_LST="64K 256K 1M 4M "
|
||
|
BS_LST="4K 16K 64K 256K 1M 4M "
|
||
|
DEPTH=32
|
||
|
POOL_EXISTS=`ceph osd lspools | grep $POOL`
|
||
|
if [[ -z $POOL_EXISTS ]] ; then
|
||
|
# Crear el pool de benchmarks
|
||
|
ceph osd pool create $POOL $POOL_PG
|
||
|
ceph osd pool set $POOL pg_autoscale_mode off
|
||
|
ceph osd pool get $POOL pg_autoscale_mode
|
||
|
ceph osd pool set $POOL pg_num $POOL_PG
|
||
|
ceph osd pool get $POOL pg_num
|
||
|
ceph osd pool get $POOL pgp_num
|
||
|
ceph osd pool application enable $POOL rbd
|
||
|
ceph osd pool get $POOL size
|
||
|
ceph osd pool get $POOL min_size
|
||
|
fi
|
||
|
|
||
|
MY_HOST=`hostname | cut -d '.' -f 1 | cut -d '-' -f 3`
|
||
|
OUT_D=/output/ceph/$MY_HOST
|
||
|
mkdir -pv $OUT_D
|
||
|
FIO_PRM_CONST="-ioengine=rbd -name=test -runtime=$R_T -pool=$POOL"
|
||
|
|
||
|
for OBJ in $OBJ_LST ; do
|
||
|
for BS in $BS_LST ; do
|
||
|
# crear imagen de 100G
|
||
|
IMG="image-$MY_HOST-$OBJ"
|
||
|
if ! rbd info $IMG --pool $POOL > /dev/null ; then
|
||
|
echo "rbd create $IMG --size $IMG_S --pool $POOL --object-size $OBJ"
|
||
|
rbd create $IMG --size $IMG_S --pool $POOL --object-size $OBJ
|
||
|
fi
|
||
|
FIO_PRM="$FIO_PRM_CONST -rbdname=$IMG "
|
||
|
for TEST in $TESTS ; do
|
||
|
echo
|
||
|
echo "BS: $BS TEST: $TEST DEPTH: $DEPTH"
|
||
|
OUT=$OUT_D/fio-$TEST-$OBJ-$BS.out
|
||
|
echo "fio $FIO_PRM --output=$OUT -rw=$TEST -bs=$BS -iodepth=$DEPTH"
|
||
|
fio $FIO_PRM --output=$OUT -rw=$TEST -bs=$BS -iodepth=$DEPTH
|
||
|
done
|
||
|
#echo "rbd remove $IMG --pool $POOL"
|
||
|
#rbd remove $IMG --pool $POOL
|
||
|
done
|
||
|
done
|
||
|
|
||
|
|