#!/bin/bash #==============================================================================# # # /root/bin/fio.sh /var/lib/mysql 4G # #==============================================================================# #RW="read" # Sequential reads. #RW="write" # Sequential writes. #RW="randread" # Random reads. #RW="randwrite" # Random writes. #RW="rw" # Mixed sequential reads and writes. RW="randrw" # Mixed random reads and writes. #==============================================================================# ### Speicherort für den Test if [ -n "${1}" ] ; then VERZEICHNISNAME="${1}" else VERZEICHNISNAME="/tmp" fi #------------------------------------------------------------------------------# ### Speichergröße für den Test if [ -n "${2}" ] ; then GROESSE="${2}" else GROESSE="4G" fi #------------------------------------------------------------------------------# ALLGEMEINE_OPTIONEN="--directory=${VERZEICHNISNAME} --size=${GROESSE} --ioengine=libaio --direct=1 --rw=${RW} --iodepth=32 --iodepth_batch=16 --iodepth_batch_complete=16 --runtime=60 --ramp_time=5 --norandommap --time_based -group_reporting" #==============================================================================# for BS in 4K 1M do for JOBS in 1 4 do FIO_LOG="$(fio --name=test01 --filename=fio${JOBS}x${BS} --numjobs=${JOBS} --bs=${BS} ${ALLGEMEINE_OPTIONEN})" echo "${FIO_LOG}" > fio${JOBS}x${BS}.log AUSGABE="$(echo "${FIO_LOG}" | egrep -i 'read|write' | fgrep -i iops | sed 's/[,]/ /g')" echo "# ${JOBS}x ${BS} / read: $(echo "${AUSGABE}" | fgrep -i read | tr -s ' ' '\n' | fgrep -i bw=) $(echo "${AUSGABE}" | fgrep -i read | tr -s ' ' '\n' | fgrep -i ops=) / write: $(echo "${AUSGABE}" | fgrep -i write | tr -s ' ' '\n' | fgrep -i bw=) $(echo "${AUSGABE}" | fgrep -i write | tr -s ' ' '\n' | fgrep -i ops=)" done done