Script that tries to keep a fixed number of clients
authorDennis Schafroth <dennis@indexdata.com>
Sun, 14 Mar 2010 10:47:34 +0000 (11:47 +0100)
committerDennis Schafroth <dennis@indexdata.com>
Sun, 14 Mar 2010 10:47:34 +0000 (11:47 +0100)
perf/bash/par_fixed_clients.sh [new file with mode: 0755]

diff --git a/perf/bash/par_fixed_clients.sh b/perf/bash/par_fixed_clients.sh
new file mode 100755 (executable)
index 0000000..7dc8779
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+DELAY=0.001
+WAIT=1
+NUMBER=100
+ROUNDS=5
+let r=0
+while test $r -lt $ROUNDS; do
+       echo "$r"
+       i=0
+       while test $i -lt $NUMBER; do
+               ./client.sh $r.$i >$r.$i.log 2>&1 &
+               CLIENTS=`ps -ef |grep -c client.sh` 
+               while test $CLIENTS -ge $NUMBER ; do
+                   sleep $WAIT
+                   CLIENTS=`ps -ef |grep -c client.sh` 
+                   echo "Active $CLIENTS"
+               done
+               let i=$i+1
+       done
+       let r=$r+1
+done
+wait
+wget -O x 'http://localhost:8010/?command=exit'