diff --git a/README.md b/README.md index f7df6cffc808608e4ec2a1ffd303e6819485c1c1..64a7fc2e2efdbe3e9bb3c75f3dfddf7f2d33640f 100644 --- a/README.md +++ b/README.md @@ -1 +1,5 @@ -Collezione di script/template per test con FIO. +Scripts/Templates collection for FIO tests. + +getInfo_v2.pl: used to extract info from FIO ver. 2 logfile. + +getInfo.pl: used to extract info from FIO ver. 3 logfile. diff --git a/doFioLoopRbd.sh b/doFioLoopRbd.sh index 193dd80bb9a84ebe0ef819829b9cf27ba51bef91..195ca5466ef980dae58e367bef407f7f5da101eb 100755 --- a/doFioLoopRbd.sh +++ b/doFioLoopRbd.sh @@ -1,5 +1,6 @@ -export RUNTIME=200 -export thePause=10 +export RUNTIME=240 +export thePause=20 +export theSmlPause=5 export subDir=$1 if [ ! -d $PWD/$subDir ]; then echo "La directory $subDir non esiste, esco." @@ -9,15 +10,15 @@ elif [ -z $subDir ]; then exit 2 fi -# for iodepth in 1 2 32 8 64 128 4 256 16 512 ; do -for iodepth in 64 256 128 4 16 ; do - for poolname in test test2 test3; do +for iodepth in 1 2 128 64 32 8 4 256 16 512 ; do +# for poolname in testFulvioSsd testFulvio.1 testFulvio.3; do + for poolname in testFulvio.1 ; do export POOLNAME=${poolname} export RBDNAME=testFio export IODEPTH=${iodepth} for numjobs in 1 ; do export NUMJOBS=${numjobs} - for blocksize in 4k 64k 1M 4M ; do + for blocksize in 4k 4M ; do export BLOCKSIZE=${blocksize} for testtype in randwrite randread randrw ; do export TESTTYPE=${testtype} @@ -30,11 +31,16 @@ for iodepth in 64 256 128 4 16 ; do echo " TESTTYPE: $TESTTYPE" echo " " export fileSuff=${POOLNAME}_${RBDNAME}_${TESTTYPE}_i${IODEPTH}_n${NUMJOBS}_b${BLOCKSIZE} - cat rbd_fio_template.txt | sed -e "s/POOLNAME/$POOLNAME/" -e "s/RBDNAME/$RBDNAME/" -e "s/IODEPTH/$IODEPTH/" -e "s/NUMJOBS/$NUMJOBS/" -e "s/BLOCKSIZE/$BLOCKSIZE/" -e "s/RUNTIME/$RUNTIME}/" -e "s/TESTTYPE/$TESTTYPE/" > ${subDir}/rbd_${fileSuff}.txt - sync ; sleep 2 - echo "Executing: fio --output=rbd_${fileSuff}.log rbd_${fileSuff}.txt" - fio --output=${subDir}/rbd_${fileSuff}.log ${subDir}/rbd_${fileSuff}.txt - sync ; echo "done rbd_${fileSuff}.txt" ; sleep $thePause + if [ ! -e ${subDir}/rbd_${fileSuff}.log ]; then + cat rbd_fio_template.txt | sed -e "s/POOLNAME/$POOLNAME/" -e "s/RBDNAME/$RBDNAME/" -e "s/IODEPTH/$IODEPTH/" -e "s/NUMJOBS/$NUMJOBS/" -e "s/BLOCKSIZE/$BLOCKSIZE/" -e "s/RUNTIME/$RUNTIME/" -e "s/TESTTYPE/$TESTTYPE/" > ${subDir}/rbd_${fileSuff}.txt + sync ; sleep 2 + echo "Executing: fio --output=${subDir}/rbd_${fileSuff}.log ${subDir}/rbd_${fileSuff}.txt" + fio --output=${subDir}/rbd_${fileSuff}.log ${subDir}/rbd_${fileSuff}.txt + sync ; echo "done rbd_${fileSuff}.txt" + echo "Sleep $thePause at `date`" ; sleep $thePause + else + echo "SKIPPED, sleep $theSmlPause at `date`" ; sleep $theSmlPause + fi done done done diff --git a/getInfo.pl b/getInfo.pl index 38f8033089b07067d1df43ffe2b1ac350bd18916..be14fbd5799614e7371cb8167ac6fddb488cde28 100755 --- a/getInfo.pl +++ b/getInfo.pl @@ -22,7 +22,7 @@ while (<FILE>) { $line = $_; $i++; if ($i == 1) { - if ($line =~ /.*rw=(\S+),\s+bs=(\S+?)-\S+ ioengine=(\S+),\s+iodepth=(\d+)/) { + if ($line =~ /.*rw=(\S+),\s+bs=.* (\S+)-\S+.*, ioengine=(\S+),\s+iodepth=(\d+)/) { ( $testName, $blockSize, $testEngine, $ioDepth ) = ( $1, $2, $3, $4); $hashTest{'all'}{'aType'} = $testName; $hashTest{'all'}{'aBsize'} = $blockSize; @@ -37,13 +37,13 @@ while (<FILE>) { $hashTest{'all'}{'aCpuU'} = $1; $hashTest{'all'}{'aCpuS'} = $2; } - if ($line =~ /(\S+)\s*: io=([0-9]*\.?[0-9]+)(\S+), bw=([0-9]*\.?[0-9]+)(\S+), iops=(\d+), runt=(\d+)(\S+)/) { + if ($line =~ /(\S+)\s*: IOPS=(\d+), BW=([0-9]*\.?[0-9]+)(\S+)\s+\(\S+\)\(([0-9]*\.?[0-9]+)(\S+)\/(\d+)(\S+)\)/) { $theTest = $1; - $hashTest{$theTest}{'iot'} = $2; - $hashTest{$theTest}{'iotunit'} = $3; - $hashTest{$theTest}{'bw'} = $4; - $hashTest{$theTest}{'bwunit'} = $5; - $hashTest{$theTest}{'iops'} = $6; + $hashTest{$theTest}{'iot'} = $5; + $hashTest{$theTest}{'iotunit'} = $6; + $hashTest{$theTest}{'bw'} = $3; + $hashTest{$theTest}{'bwunit'} = $4; + $hashTest{$theTest}{'iops'} = $2; $hashTest{$theTest}{'rt'} = $7; $hashTest{$theTest}{'rtunit'} = $8; $clatUnit = ""; diff --git a/getInfo_v2.pl b/getInfo_v2.pl new file mode 100755 index 0000000000000000000000000000000000000000..38f8033089b07067d1df43ffe2b1ac350bd18916 --- /dev/null +++ b/getInfo_v2.pl @@ -0,0 +1,96 @@ +#!/usr/bin/perl + + +my $file = $ARGV[0]; + +open(FILE,"<$file") || die "Cannot open file $file: $!\n"; + +$testName = ""; +$blockSize= ""; +$testEngine=""; +$ioDepth=0; +$cpuU=0; +$cpuS=0; +$i=0; +$nProc=0; +%hashTest = (); + +my @clat = ("50.00th", "90.00th", "95.00th", "99.00th"); + + +while (<FILE>) { + $line = $_; + $i++; + if ($i == 1) { + if ($line =~ /.*rw=(\S+),\s+bs=(\S+?)-\S+ ioengine=(\S+),\s+iodepth=(\d+)/) { + ( $testName, $blockSize, $testEngine, $ioDepth ) = ( $1, $2, $3, $4); + $hashTest{'all'}{'aType'} = $testName; + $hashTest{'all'}{'aBsize'} = $blockSize; + $hashTest{'all'}{'aTestEngine'} = $testEngine; + $hashTest{'all'}{'aIOdepth'} = $ioDepth; + } + } + if ($line =~ /^Starting (\d+)/) { + $hashTest{'all'}{'aNproc'} = $1; + } + if ($line =~ /.*cpu.*usr=([0-9]*\.[0-9]+)%,\s+sys=([0-9]*\.[0-9]+)%,/) { + $hashTest{'all'}{'aCpuU'} = $1; + $hashTest{'all'}{'aCpuS'} = $2; + } + if ($line =~ /(\S+)\s*: io=([0-9]*\.?[0-9]+)(\S+), bw=([0-9]*\.?[0-9]+)(\S+), iops=(\d+), runt=(\d+)(\S+)/) { + $theTest = $1; + $hashTest{$theTest}{'iot'} = $2; + $hashTest{$theTest}{'iotunit'} = $3; + $hashTest{$theTest}{'bw'} = $4; + $hashTest{$theTest}{'bwunit'} = $5; + $hashTest{$theTest}{'iops'} = $6; + $hashTest{$theTest}{'rt'} = $7; + $hashTest{$theTest}{'rtunit'} = $8; + $clatUnit = ""; + do { + my $l = <FILE>; + if ( $l =~ /clat percentiles \((\w+)\)/ ) { + $clatUnit = $1; + $hashTest{$theTest}{"clatUnit"} = $clatUnit; + $endClat = 0; + do { + my $l2 = <FILE>; + $endClat = 1 if ( $l2 !~ /,\s+$/); + for $aClat ( @clat ) { + if ( $l2 =~ /$aClat=\[\s*(\d+)\]/) { + $hashTest{$theTest}{"clat".$aClat} = $1; + } + } + } while (! $endClat); + } + } while ($clatUnit eq ""); + } +} + +my $lineT = ""; +my $lineV = ""; +my $sep = ","; +my $counter = 0; +for $test ( sort keys %hashTest ) { + $counter++; + if ( $counter == 1 ) { + $lineT .= "a".$test; + $lineV .= $test; + } else { + $lineT .= $sep.$test; + $lineV .= $sep.$test; + } + print "DEBUG: $test \t"; + for $item ( sort keys %{ $hashTest{$test} } ) { + print " $item=$hashTest{$test}{$item}"; + $lineT .= $sep.$item; + $lineV .= $sep.$hashTest{$test}{$item}; + } + print "\n"; +} + + + +print "DEBUG: $file was a:\t test $testName with bs=$blockSize engine=$testEngine ioDepth=$ioDepth nProc=$nProc\n"; + +print "$lineT\n$lineV\n"; diff --git a/populate.sh b/populate.sh index 34f234fb5eb3264d9e6fb4b9f11dd4c4beef6179..00fd55cce151fe832466ba1442bb4d8c276d9ea8 100755 --- a/populate.sh +++ b/populate.sh @@ -7,11 +7,11 @@ # http://rajaseelan.com/2009/07/29/generate-files-with-random-content-and-size-in-bash/ # ######## User settings ############ -MAXDIRS=50 +MAXDIRS=20 MAXDEPTH=5 MAXFILES=5 # Max Size in kB -MAXSIZE=4000000 +MAXSIZE=2000000 # Maximum fraction of filesystem to fill MAXFRACTION=90 ######## End of user settings ############ @@ -30,7 +30,7 @@ else echo "Dir $baseDir does not exist, exiting now" exit 2 fi -sleep 5 +sleep 3 # How deep in the file system are we now? TOP=`pwd|tr -cd '/'|wc -c` @@ -38,6 +38,7 @@ TOP=`pwd|tr -cd '/'|wc -c` populate() { cd $1 curdir=$PWD + echo "Current dir now: $curdir" files=$(($RANDOM*$MAXFILES/32767)) for n in `seq $files` @@ -70,6 +71,7 @@ populate() { for dir in $dirlist do + echo "...loop populate path: $dir" populate "$dir" done }