From 650dc8949488e88797a61908723619aca5fc8909 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 5 Sep 2008 19:53:44 +0000 Subject: Fixed cluster membership notification. Cluster events with RefCountedBuffers for queueing. PollableQueue clears bacth immediately. Improved perfdist: clients hit multiple brokers in a cluster. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@692521 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/benchmark | 52 +++++++++++++++++++++------------- qpid/cpp/src/tests/perfdist | 38 +++++++++++++++---------- qpid/cpp/src/tests/start_cluster_hosts | 16 +++++------ 3 files changed, 63 insertions(+), 43 deletions(-) (limited to 'qpid/cpp/src/tests') diff --git a/qpid/cpp/src/tests/benchmark b/qpid/cpp/src/tests/benchmark index 9e8023043b..5381fd69fa 100755 --- a/qpid/cpp/src/tests/benchmark +++ b/qpid/cpp/src/tests/benchmark @@ -21,33 +21,45 @@ # and latency against a single cluster member while they are replicating. # # Must be run in the qpid src/tests build directory. -# +# +usage() { +cat < -- +usage: $0 -- [ --- ] +Client & broker hosts can also be set in env vars CLIENTS and BROKERS. -Run perftest with clients running on the listed hosts. Clients are -assigned to hosts publishers first, then subscribers the host list is -used round-robin if there are more clients than hosts. perftest-args should -include a --host flag (and --port if necessary). +Run perftest with clients running on the clients and brokers running +on the specified hosts. Clients are assigned to client hosts round +robin: publishers first, then subscribers. If there are multiple +brokers (for cluster tests) clients connect to them round robin. -Do not pass preftest action flags: --setup, --control, --publish, --subscribe. -The script will pass them to the appropriate client processes. - -Note all perftest args must come before --. +Broker hosts can be listed with -b in perftest-args or after --- +at the end of the arguments. Error: $* EOF @@ -36,19 +35,28 @@ while test $# -gt 0; do --npubs) collect $1 $2; NPUBS=$2; shift 2 ;; --nsubs) collect $1 $2; NSUBS=$2; shift 2 ;; -s|--summary) collect $1; QUIET=yes; shift 1 ;; - --) COLLECT=HOSTS; shift ;; + -b|--broker) BROKERS="$BROKERS $2"; shift 2;; + --) COLLECT=CLIENTARG; shift ;; + ---) COLLECT=BROKERARG; shift;; *) collect $1; shift ;; esac done -if [ -z "$HOSTS" ]; then usage "No hosts listed after --"; fi +CLIENTS=${CLIENTARG:-$CLIENTS} +if [ -z "$CLIENTS" ]; then usage "No client hosts listed after --"; fi +BROKERS=${BROKERARG:-$BROKERS} +if [ -z "$BROKERS" ]; then usage "No brokers specified"; fi + PERFTEST="$TESTDIR/perftest $ARGS" -HOSTS=($HOSTS) +CLIENTS=($CLIENTS) +BROKERS=($BROKERS) start() { - HOST=${HOSTS[i % ${#HOSTS[*]}]} - test -z "$QUIET" && echo "Client $i on $HOST $*" - ssh -fT $HOST "PATH=$ADDPATH:\$PATH" $PERFTEST "$@" + CLIENT=${CLIENTS[i % ${#CLIENTS[*]}]} + BROKER=${BROKERS[i % ${#BROKERS[*]}]} + ARGS="$* --broker $BROKER" + test -z "$QUIET" && echo "Client $i on $CLIENT: $ARGS" + ssh -fT $CLIENT $PERFTEST "$@" } $PERFTEST --setup diff --git a/qpid/cpp/src/tests/start_cluster_hosts b/qpid/cpp/src/tests/start_cluster_hosts index 37dda882ca..683798453b 100755 --- a/qpid/cpp/src/tests/start_cluster_hosts +++ b/qpid/cpp/src/tests/start_cluster_hosts @@ -16,14 +16,14 @@ QPIDD=${QPIDD:-$PWD/../qpidd} LIBQPIDCLUSTER=${LIBQPIDCLUSTER:-$PWD/../.libs/libqpidcluster.so} -CLUSTER=$USER # User name is default cluster name. +NAME=$USER # User name is default cluster name. RESTART=NO -while getopts "kp:c:q:r" ARG ; do +while getopts "kp:n:q:r" ARG ; do case $ARG in k) KILL=yes ;; p) PORT="$OPTARG" ;; - c) CLUSTER=$OPTARG ;; + n) NAME=$OPTARG ;; q) QPIDD=$OPTARG ;; l) LIBQPIDCLUSTER=$OPTARG ;; r) RESTART=yes ;; @@ -33,17 +33,17 @@ done shift `expr $OPTIND - 1` test -n "$PORT" && PORTOPT="-p $PORT" test "$KILL" = yes && KILL="$QPIDD -q $PORTOPT ;" -test -z "$*" && { echo Must specify at least one host; exit 1; } +CLUSTER=${*:-$CLUSTER} # Use args or env +test -z "$CLUSTER" && { echo Must specify at least one host; exit 1; } -OPTS="-d $PORTOPT --load-module $LIBQPIDCLUSTER --cluster-name=$CLUSTER --no-data-dir --auth=no --log-output=syslog" +OPTS="-d $PORTOPT --load-module $LIBQPIDCLUSTER --cluster-name=$NAME --no-data-dir --auth=no --log-output=syslog --log-enable=info+" num=0 -for h in $*; do +for h in $CLUSTER; do num=`expr $num + 1` # Give a unique log prefix to each node. cmd="$KILL $QPIDD $OPTS --log-prefix $num.$h" - echo == $h - out=`echo "$cmd" | ssh $h newgrp ais` || { echo $out ; exit 1; } + out=`echo "$cmd" | ssh $h newgrp ais` || { echo == $h error: $out ; exit 1; } if [ "$PORT" = 0 ] ; then p=$out; else p=$PORT; fi echo "$h $p" done -- cgit v1.2.1