Whamcloud - gitweb
LU-4018 tests: improve racer file_create workload 51/7951/4
authorAndreas Dilger <andreas.dilger@intel.com>
Tue, 15 Oct 2013 16:05:50 +0000 (10:05 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 1 Jul 2014 04:24:28 +0000 (04:24 +0000)
Use larger writes and smaller files, so that the racer file_create.sh
workload does not get bogged down with many threads stuck on sub-page
writes to the same file (causing excruciating 1kB-per-RPC sync writes
to disk on the OST).

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I173c155dfe4044f89deb8f2d8a7c3be4a28ce763
Reviewed-on: http://review.whamcloud.com/7951
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/racer/file_create.sh
lustre/tests/racer/racer.sh

index 828e69c..e615365 100755 (executable)
@@ -2,16 +2,17 @@
 
 DIR=$1
 MAX=$2
-MAX_MB=256
+MAX_MB=${RACER_MAX_MB:-8}
 
 OSTCOUNT=${OSTCOUNT:-$(lfs df $DIR 2> /dev/null | grep -c OST)}
 
 while /bin/true ; do 
        file=$((RANDOM % MAX))
-       SIZE=$((RANDOM * MAX_MB / 32))
-       echo "file_create: FILE=$DIR/$file SIZE=$SIZE"
+       # $RANDOM is between 0 and 32767, and we want $blockcount in 64kB units
+       blockcount=$((RANDOM * MAX_MB / 32 / 64))
+       stripecount=$((RANDOM % (OSTCOUNT + 1)))
        [ $OSTCOUNT -gt 0 ] &&
-               lfs setstripe -c $((RANDOM % OSTCOUNT)) $DIR/$file 2> /dev/null
-       dd if=/dev/zero of=$DIR/$file bs=1k count=$SIZE 2> /dev/null
+               lfs setstripe -c $stripecount $DIR/$file 2> /dev/null
+       dd if=/dev/zero of=$DIR/$file bs=64k count=$blockcount 2> /dev/null
 done
 
index 6ba8b7c..1da6465 100755 (executable)
@@ -23,7 +23,7 @@ racer_cleanup()
 {
        echo "racer cleanup"
        for P in $RACER_PROGS; do
-               killall $P.sh
+               killall -q $P.sh
        done
        trap 0
 
@@ -43,14 +43,14 @@ racer_cleanup()
                done
                if [[ $rc -eq 0 ]]; then
                        echo there should be NO racer processes:
-                       ps aux | grep -E "${RACER_PROGS// /|}"
+                       ps uww -C "${RACER_PROGS// /,}"
                        return 0
                fi
                echo -n "Waited $(( TOT_WAIT + SHORT_WAIT)), rc=$rc "
                (( SHORT_WAIT+=SHORT_WAIT ))
                (( TOT_WAIT+=SHORT_WAIT ))
        done
-       ps aux | grep -E "${RACER_PROGS// /|}"
+       ps uww -C "${RACER_PROGS// /,}"
        return 1
 }
 
@@ -76,7 +76,5 @@ racer_cleanup || RC=$?
 # Check our to see whether our test DIR is still available.
 df $DIR
 (( RC+=$? ))
-if [ $RC -eq 0 ]; then
-    echo "We survived $0 for $DURATION seconds."
-fi
+[ $RC -eq 0 ] && echo "We survived $0 for $DURATION seconds."
 exit $RC