From e72d48d1064abc3e3c304ebbf2492570a46d48ce Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Sun, 14 Mar 2010 11:47:34 +0100 Subject: [PATCH] Script that tries to keep a fixed number of clients --- perf/bash/par_fixed_clients.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 perf/bash/par_fixed_clients.sh diff --git a/perf/bash/par_fixed_clients.sh b/perf/bash/par_fixed_clients.sh new file mode 100755 index 0000000..7dc8779 --- /dev/null +++ b/perf/bash/par_fixed_clients.sh @@ -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' -- 1.7.10.4