Script that tries to keep a fixed number of clients
[pazpar2-moved-to-github.git] / perf / bash / par_fixed_clients.sh
1 #!/bin/bash
2 DELAY=0.001
3 WAIT=1
4 NUMBER=100
5 ROUNDS=5
6 let r=0
7 while test $r -lt $ROUNDS; do
8         echo "$r"
9         i=0
10         while test $i -lt $NUMBER; do
11                 ./client.sh $r.$i >$r.$i.log 2>&1 &
12                 CLIENTS=`ps -ef |grep -c client.sh` 
13                 while test $CLIENTS -ge $NUMBER ; do
14                     sleep $WAIT
15                     CLIENTS=`ps -ef |grep -c client.sh` 
16                     echo "Active $CLIENTS"
17                 done
18                 let i=$i+1
19         done
20         let r=$r+1
21 done
22 wait
23 wget -O x 'http://localhost:8010/?command=exit'