From a38522260581d742ab0b8db814bc906a79220c12 Mon Sep 17 00:00:00 2001 From: Sandino Araico Sanchez Date: Thu, 30 Jun 2022 18:36:46 -0500 Subject: [PATCH] scripts para el test-fio --- scripts/test-fio-rbd | 48 ++++++++++++++++++++++++ scripts/test-fio-rbd-32 | 51 +++++++++++++++++++++++++ scripts/test-fio-rbd-jobs | 79 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 178 insertions(+) create mode 100755 scripts/test-fio-rbd create mode 100755 scripts/test-fio-rbd-32 create mode 100755 scripts/test-fio-rbd-jobs diff --git a/scripts/test-fio-rbd b/scripts/test-fio-rbd new file mode 100755 index 0000000..99dee33 --- /dev/null +++ b/scripts/test-fio-rbd @@ -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 + + diff --git a/scripts/test-fio-rbd-32 b/scripts/test-fio-rbd-32 new file mode 100755 index 0000000..16fc2d8 --- /dev/null +++ b/scripts/test-fio-rbd-32 @@ -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 + + diff --git a/scripts/test-fio-rbd-jobs b/scripts/test-fio-rbd-jobs new file mode 100755 index 0000000..d3a3a51 --- /dev/null +++ b/scripts/test-fio-rbd-jobs @@ -0,0 +1,79 @@ +#!/bin/bash + +if [[ -z $1 ]] ; then + echo "usage: $0 " + 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 + +