you need to install+enable the apache module "proxy_balancer" for load balancing...
[pazpar2-moved-to-github.git] / perf / bash / par_fixed_clients.sh
1 #!/bin/bash
2 NUMBER=$1
3 if [ -z "$NUMBER" ] ; then
4     NUMBER=20
5 fi
6
7 DELAY=0.001
8 WAIT=1
9 #NUMBER=100
10 ROUNDS=2
11 let r=0
12 PORT=9005
13 CLIENT_SCRIPT="client_timed.sh"
14 while test $r -lt $ROUNDS; do
15         echo "$r"
16         i=0
17         while test $i -lt $NUMBER; do
18                 ./${CLIENT_SCRIPT} $r.$i $PORT >$r.$i.log 2>&1 &
19                 CLIENTS=`ps -ef |grep -c ${CLIENT_SCRIPT}` 
20                 while test $CLIENTS -ge $NUMBER ; do
21                     sleep $WAIT
22                     CLIENTS=`ps -ef |grep -c ${CLIENT_SCRIPT}` 
23                     echo "Active $CLIENTS"
24                 done
25                 let i=$i+1
26         done
27         let r=$r+1
28 done
29 wait
30 cat *.time > timed.$NUMBER.log
31 #wget --tries=1 -O x "http://localhost:${PORT}/?command=exit"
32 sleep 5