#!/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