scripts para el test-fio

This commit is contained in:
Sandino Araico Sanchez 2022-06-30 18:36:46 -05:00
parent 6ef879203d
commit a385222605
3 changed files with 178 additions and 0 deletions

48
scripts/test-fio-rbd Executable file
View file

@ -0,0 +1,48 @@
#!/bin/bash
POOL=rbdbench
POOL_PG=4096
IMG_S=500G
R_T=60
TESTS="randwrite randread randrw"
BS_LST="4K 16K 64K 256K 1M 4M "
DEPTH_LST="1 2 4 8 16 32 64 128 256"
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 BS in $BS_LST ; do
# crear imagen de 100G
IMG="image-$MY_HOST-$BS"
echo "rbd create $IMG --size $IMG_S --pool $POOL --object-size $BS"
rbd create $IMG --size $IMG_S --pool $POOL --object-size $BS
FIO_PRM="$FIO_PRM_CONST -rbdname=$IMG "
for TEST in $TESTS ; do
for DEPTH in $DEPTH_LST ; do
echo
echo "BS: $BS TEST: $TEST DEPTH: $DEPTH"
OUT=$OUT_D/fio-$TEST-$BS-$DEPTH.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
done
#echo "rbd remove $IMG --pool $POOL"
#rbd remove $IMG --pool $POOL
done

51
scripts/test-fio-rbd-32 Executable file
View file

@ -0,0 +1,51 @@
#!/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

79
scripts/test-fio-rbd-jobs Executable file
View file

@ -0,0 +1,79 @@
#!/bin/bash
if [[ -z $1 ]] ; then
echo "usage: $0 <numjobs>"
exit 1
fi
JOBS=`sed 's/[^0-9]//g' <<< $1`
if [[ $JOBS -lt 1 ]] ; then
echo "jobs must be positive integer"
exit 2
fi
POOL=rbdbench
POOL_PG=4096
IMG_S=500G
R_T=60
TESTS="randwrite randread randrw "
OBJ="4M"
BS_LST="4K 64K"
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
echo 8192 > /proc/sys/kernel/shmmni
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 (( JOB=1 ; JOB <= $JOBS ; JOB++ )) ; do
#echo "JOB: $JOB"
IMG="image-$MY_HOST-$OBJ-$JOB"
# crear imagen de 100G
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
done
for BS in $BS_LST ; do
for TEST in $TESTS ; do
cat > rbd.fio << EOF
[global]
ioengine=rbd
pool=$POOL
rw=$TEST
bs=$BS
iodepth=$DEPTH
runtime=$R_T
EOF
for (( JOB=1 ; JOB <= $JOBS ; JOB++ )) ; do
IMG="image-$MY_HOST-$OBJ-$JOB"
cat >> rbd.fio << EOF
[job$JOB]
rbdname=$IMG
EOF
done
echo "BS: $BS TEST: $TEST JOBS: $JOBS"
OUT=$OUT_D/fio-$TEST-$OBJ-$BS-${JOBS}p.out
echo "fio --output=$OUT rbd.fio"
fio --output=$OUT rbd.fio
sleep 5
done
done