Skip to content
Snippets Groups Projects
Commit 71ae4129 authored by Elena Gryaznova's avatar Elena Gryaznova
Browse files

b=14330

i=Adilger

RUNAS dbench and iozone
parent c37a7e75
No related branches found
No related tags found
No related merge requests found
...@@ -100,27 +100,33 @@ for NAME in $CONFIGS; do ...@@ -100,27 +100,33 @@ for NAME in $CONFIGS; do
which dbench > /dev/null 2>&1 || DBENCH=no which dbench > /dev/null 2>&1 || DBENCH=no
if [ "$DBENCH" != "no" ]; then if [ "$DBENCH" != "no" ]; then
title dbench title dbench
DBENCHDIR=$MOUNT/$HOSTNAME
mkdir -p $DBENCHDIR
SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'` SPACE=`df -P $MOUNT | tail -n 1 | awk '{ print $4 }'`
DB_THREADS=$((SPACE / 50000)) DB_THREADS=$((SPACE / 50000))
[ $THREADS -lt $DB_THREADS ] && DB_THREADS=$THREADS [ $THREADS -lt $DB_THREADS ] && DB_THREADS=$THREADS
$DEBUG_OFF $DEBUG_OFF
myUID=$RUNAS_ID
myRUNAS=$RUNAS
FAIL_ON_ERROR=false check_runas_id $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
chown $myUID:$myUID $DBENCHDIR
duration="" duration=""
[ "$SLOW" = "no" ] && duration=" -t 120" [ "$SLOW" = "no" ] && duration=" -t 120"
if [ "$SLOW" != "no" -o $DB_THREADS -eq 1 ]; then if [ "$SLOW" != "no" -o $DB_THREADS -eq 1 ]; then
bash rundbench 1 $duration DIR=$DBENCHDIR $myRUNAS bash rundbench 1 $duration
$DEBUG_ON $DEBUG_ON
$CLEANUP $CLEANUP
$SETUP $SETUP
fi fi
if [ $DB_THREADS -gt 1 ]; then if [ $DB_THREADS -gt 1 ]; then
$DEBUG_OFF $DEBUG_OFF
bash rundbench $DB_THREADS $duration DIR=$DBENCHDIR $myRUNAS bash rundbench $DB_THREADS $duration
$DEBUG_ON $DEBUG_ON
$CLEANUP $CLEANUP
$SETUP $SETUP
fi fi
rm -f /mnt/lustre/`hostname`/client.txt rm -rf $DBENCHDIR
DBENCH="done" DBENCH="done"
fi fi
...@@ -151,18 +157,23 @@ for NAME in $CONFIGS; do ...@@ -151,18 +157,23 @@ for NAME in $CONFIGS; do
which iozone > /dev/null 2>&1 || IOZONE=no which iozone > /dev/null 2>&1 || IOZONE=no
if [ "$IOZONE" != "no" ]; then if [ "$IOZONE" != "no" ]; then
title iozone title iozone
mkdir -p $MOUNT/d0.iozone IOZDIR=$MOUNT/d0.iozone
$LFS setstripe -c -1 $MOUNT/d0.iozone mkdir -p $IOZDIR
$LFS setstripe -c -1 $IOZDIR
sync sync
MIN=`cat /proc/fs/lustre/osc/*/kbytesavail | sort -n | head -n1` MIN=`cat /proc/fs/lustre/osc/*/kbytesavail | sort -n | head -n1`
SPACE=$(( OSTCOUNT * MIN )) SPACE=$(( OSTCOUNT * MIN ))
[ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4)) [ $SPACE -lt $SIZE ] && SIZE=$((SPACE * 3 / 4))
log "min OST has ${MIN}kB available, using ${SIZE}kB file size" log "min OST has ${MIN}kB available, using ${SIZE}kB file size"
IOZONE_OPTS="-i 0 -i 1 -i 2 -e -+d -r $RSIZE -s $SIZE" IOZONE_OPTS="-i 0 -i 1 -i 2 -e -+d -r $RSIZE -s $SIZE"
IOZFILE="$MOUNT/d0.iozone/iozone" IOZFILE="$IOZDIR/iozone"
# $SPACE was calculated with all OSTs # $SPACE was calculated with all OSTs
$DEBUG_OFF $DEBUG_OFF
iozone $IOZONE_OPTS -f $IOZFILE myUID=$RUNAS_ID
myRUNAS=$RUNAS
FAIL_ON_ERROR=false check_runas_id $myUID $myRUNAS || { myRUNAS="" && myUID=$UID; }
chown $myUID:$myUID $IOZDIR
$myRUNAS iozone $IOZONE_OPTS -f $IOZFILE
$DEBUG_ON $DEBUG_ON
$CLEANUP $CLEANUP
$SETUP $SETUP
...@@ -177,7 +188,8 @@ for NAME in $CONFIGS; do ...@@ -177,7 +188,8 @@ for NAME in $CONFIGS; do
fi fi
if [ "$O_DIRECT" != "no" -a "$IOZONE_DIR" != "no" ]; then if [ "$O_DIRECT" != "no" -a "$IOZONE_DIR" != "no" ]; then
$DEBUG_OFF $DEBUG_OFF
iozone -I $IOZONE_OPTS $IOZFILE.odir # cd TMP to have write permission for tmp file iozone writes
( cd $TMP && $myRUNAS iozone -I $IOZONE_OPTS $IOZFILE.odir )
$DEBUG_ON $DEBUG_ON
$CLEANUP $CLEANUP
$SETUP $SETUP
...@@ -188,15 +200,15 @@ for NAME in $CONFIGS; do ...@@ -188,15 +200,15 @@ for NAME in $CONFIGS; do
[ $THREADS -lt $IOZ_THREADS ] && IOZ_THREADS=$THREADS [ $THREADS -lt $IOZ_THREADS ] && IOZ_THREADS=$THREADS
IOZVER=`iozone -v | awk '/Revision:/ {print $3}' | tr -d .` IOZVER=`iozone -v | awk '/Revision:/ {print $3}' | tr -d .`
if [ "$IOZ_THREADS" -gt 1 -a "$IOZVER" -ge 3145 ]; then if [ "$IOZ_THREADS" -gt 1 -a "$IOZVER" -ge 3145 ]; then
$LFS setstripe -c 1 $MOUNT/d0.iozone $LFS setstripe -c 1 $IOZDIR
$DEBUG_OFF $DEBUG_OFF
THREAD=1 THREAD=1
IOZFILE="-F " IOZFILE="-F "
while [ $THREAD -le $IOZ_THREADS ]; do while [ $THREAD -le $IOZ_THREADS ]; do
IOZFILE="$IOZFILE $MOUNT/iozone.$THREAD" IOZFILE="$IOZFILE $IOZDIR/iozone.$THREAD"
THREAD=$((THREAD + 1)) THREAD=$((THREAD + 1))
done done
iozone $IOZONE_OPTS -t $IOZ_THREADS $IOZFILE $myRUNAS iozone $IOZONE_OPTS -t $IOZ_THREADS $IOZFILE
$DEBUG_ON $DEBUG_ON
$CLEANUP $CLEANUP
$SETUP $SETUP
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment