5 [ -n "$WEBSTONEROOT" ] || WEBSTONEROOT
=`pwd`/..
/
12 FILELIST
=$WEBSTONEROOT/conf
/filelist
17 .
$WEBSTONEROOT/conf
/testbed
19 [ -n "$DEBUG" ] && set +x
22 [ -n "$ITERATIONS" ] || ITERATIONS
="1"
23 [ -n "$MINCLIENTS" ] || MINCLIENTS
="1"
24 [ -n "$MAXCLIENTS" ] || MAXCLIENTS
="1"
25 [ -n "$CLIENTINCR" ] || CLIENTINCR
="1"
26 [ -n "$TIMEPERRUN" ] || TIMEPERRUN
="1"
27 # don't care about PROXYSERVER
28 [ -n "$SERVER" ] || SERVER
="www"
29 [ -n "$PORTNO" ] || PORTNO
="80"
30 # [ -n "$SERVERINFO" ] || SERVERINFO="uname -a"
34 # WEBSERVERTUNINGFILES
35 [ -n "$CLIENTS" ] || CLIENTS
="localhost"
36 [ -n "$CLIENTACCOUNT" ] || CLIENTACCOUNT
=$USER
37 [ -n "$CLIENTPASSWORD" ] || CLIENTPASSWORD
=$CLIENTACCOUNT
38 # [ -n "$CLIENTINFO" ] || CLIENTINFO="uname -a"
39 [ -n "$TMPDIR" ] || TMPDIR
="/tmp"
40 [ -n "$RCP" ] || RCP
="rcp"
41 [ -n "$RSH" ] || RSH
="rsh"
43 export ITERATIONS MINCLIENTS MAXCLIENTS CLIENTINCR TIMEPERRUN
44 export SERVER PORTNO SERVERINFO
45 export CLIENTS CLIENTACCOUNT CLIENTPASSWORD CLIENTINFO
48 echo "Clients: " $CLIENTS
53 NUMCLIENTHOSTS
=`echo $CLIENTS | wc -w`
54 TRIALS
=`expr 1 + \( $MAXCLIENTS - $MINCLIENTS \) / $CLIENTINCR`
55 RUNTIME
=`expr 60 \* $ITERATIONS \* $TRIALS \* $TIMEPERRUN`
56 RUNTIME
=`expr $RUNTIME + $TRIALS \* \( $MAXCLIENTS + $MINCLIENTS \) \
57 / \( 2 \* $NUMCLIENTHOSTS \)`
59 echo "Estimated run time:" `expr $RUNTIME / 3600` "hours" \
60 `expr $RUNTIME % 3600 / 60` "minutes"
63 # Checking for valid set of benchmark files to retrieve
65 #if [ -z "$PROXYSERVER" ]
67 # echo "Checking for a valid set of benchmark files"
68 # CHECKLISTTMP=$TMPDIR/webstone-checkfilelist.$$
69 # rm -f $CHECKFILELISTTMP
70 # $WEBSTONEROOT/bin/checkfilelist $SERVER $PORTNO $FILELIST > $CHECKLISTTMP 2>&1
71 # if [ `grep -c ' 4[0-9][0-9] '< $CHECKLISTTMP` -gt 0 ]
73 # echo "ERROR: not all files in filelist are on server:"
74 # echo "----- checkfilelist results -----"
76 # echo "----- checkfilelist results -----"
80 # echo "OK: All files found"
87 # distribute webclient binary
91 $RCP $WEBSTONEROOT/bin
/webclient
$i:$TMPDIR #/usr/local/bin
96 while [ $J -le $ITERATIONS ]
98 NUMCLIENTS
=$MINCLIENTS
99 while [ $NUMCLIENTS -le $MAXCLIENTS ]
101 echo "***** Iteration $J, Total clients "`expr $NUMCLIENTS`" **********"
103 TIMESTAMP
=`date +"%y%m%d_%H%M"`
104 LOGDIR
=$WEBSTONEROOT/bin
/runs
/$TIMESTAMP
109 for client
in $CLIENTS
111 $RSH $client "rm /tmp/webstone-debug*" > /dev
/null
2>&1
117 CLIENTSPERHOST
=`expr $NUMCLIENTS / $NUMCLIENTHOSTS`
118 EXTRACLIENTS
=`expr $NUMCLIENTS % $NUMCLIENTHOSTS`
122 if [ $EXTRACLIENTS -gt 0 ]
124 echo "$i $CLIENTACCOUNT $CLIENTPASSWORD `expr $CLIENTSPERHOST + 1`" \
126 EXTRACLIENTS
=`expr $EXTRACLIENTS - 1`
128 echo "$i $CLIENTACCOUNT $CLIENTPASSWORD $CLIENTSPERHOST" \
132 cp $FILELIST $LOGDIR/`basename $FILELIST`
135 # Put test configuration files on clients
137 for i
in $CLIENTS localhost
139 $RSH $i "rm -f $TMPDIR/config $TMPDIR/`basename $FILELIST`"
140 $RCP $LOGDIR/config
$i:$TMPDIR/config
141 $RCP $LOGDIR/`basename $FILELIST` $i:$TMPDIR/filelist
145 # Get starting configuration and stats from each participant
147 $RSH $SERVER "$SERVERINFO" > $LOGDIR/hardware.
$SERVER 2>&1
150 $RSH $i "$CLIENTINFO" > $LOGDIR/hardware.
$i 2>&1
154 for i
in $OSTUNINGFILES $WEBSERVERTUNINGFILES
156 $RCP $SERVER:$i $LOGDIR
164 CMD
="$WEBSTONEROOT/bin/webmaster -v -u $TMPDIR/filelist"
165 CMD
=$CMD" -f $TMPDIR/config -l $TIMEPERRUN"
166 [ -n "$SERVER" ] && CMD
=$CMD" -w $SERVER"
167 [ -n "$PORTNO" ] && CMD
=$CMD" -p $PORTNO"
168 [ -n "$PROXYSERVER" ] && CMD
=$CMD" -P $PROXYSERVER"
169 [ -n "$DEBUG" ] && CMD
=$CMD" -d"
172 # dump environment into $LOGDIR
173 rm -rf $LOGDIR/controller.env
174 env
> $LOGDIR/controller.env
176 $CMD |
tee $LOGDIR/run
179 # Get ending configuration and stats from each participant
182 #for i in $SERVER $CLIENTS
184 #$WEBSTONEROOT/bin/getstats $i > $LOGDIR/end.$i 2>&1
187 NUMCLIENTS
=`expr $NUMCLIENTS + $CLIENTINCR`