Skip to content

Commit

Permalink
Added run scripts to automate benchmarking against the latest release…
Browse files Browse the repository at this point in the history
…d server versions.
  • Loading branch information
chirino committed Dec 25, 2011
1 parent ee0cc64 commit a3bf4dd
Show file tree
Hide file tree
Showing 23 changed files with 1,291 additions and 2,362 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ target
eclipse-classes
project/boot
lib_managed
workspace
59 changes: 59 additions & 0 deletions bin/benchmark-activemq
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash
#
# This shell script automates running the stomp-benchmark [1] against the
# Apache ActiveMQ project [2].
#
# [1]: http://github.com/chirino/stomp-benchmark
# [2]: http://activemq.apache.org
#

true \
${ACTIVEMQ_VERSION:=5.5.1} \
${ACTIVEMQ_DOWNLOAD:="http://archive.apache.org/dist/activemq/apache-activemq/${ACTIVEMQ_VERSION}/apache-activemq-${ACTIVEMQ_VERSION}-bin.tar.gz"}
BASEDIR=`dirname "$0"`/.. ; cd "${BASEDIR}" ; BASEDIR=`pwd` ; cd - > /dev/null
. ${BASEDIR}/bin/benchmark-setup

#
# Install the apollo distro
#
ACTIVEMQ_HOME="${WORKSPACE}/apache-activemq-${ACTIVEMQ_VERSION}"
if [ ! -d "${ACTIVEMQ_HOME}" ]; then
cd "${WORKSPACE}"
wget "$ACTIVEMQ_DOWNLOAD"
tar -zxvf apache-activemq-${ACTIVEMQ_VERSION}-bin.tar.gz
rm -rf apache-activemq-${ACTIVEMQ_VERSION}-bin.tar.gz
fi


#
# Cleanup preious executions.
killall -9 java erl epmd apollo > /dev/null 2>&1
rm -rf ${ACTIVEMQ_HOME}/data/*

#
# Configuration
export ACTIVEMQ_OPTS="-Xmx4G -Xms1G -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Djava.util.logging.config.file=logging.properties"

#
# Start the broker
#
CONSOLE_LOG="${REPORTS_HOME}/activemq-${ACTIVEMQ_VERSION}.log"
"${ACTIVEMQ_HOME}/bin/activemq" console "xbean:file:${ACTIVEMQ_HOME}/conf/activemq.xml" > "${CONSOLE_LOG}" 2>&1 &
ACTIVEMQ_PID=$!
echo "Started ActiveMQ with PID: ${ACTIVEMQ_PID}"
sleep 5
cat ${CONSOLE_LOG}

#
# Run the benchmark
#
cd "${BASEDIR}/jms-benchmark-activemq"
export CLASSPATH=`mvn dependency:build-classpath | grep -v "\["`
export CLASSPATH="${CLASSPATH}:target/classes"
benchmark --provider activemq --display-errors --url tcp://localhost:61616 "${REPORTS_HOME}/activemq-${ACTIVEMQ_VERSION}-openwire.json"

# Kill the broker
kill -9 ${ACTIVEMQ_PID}

# Create a report.
"${BASEDIR}/bin/benchmark-report" $*
12 changes: 12 additions & 0 deletions bin/benchmark-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# Runs all the benchmarks.
#

BASEDIR=`dirname "$0"`/.. ; cd "${BASEDIR}" ; BASEDIR=`pwd` ; cd - > /dev/null
export SKIP_REPORT="true"
"${BASEDIR}/bin/benchmark-activemq" $*
"${BASEDIR}/bin/benchmark-apollo" $*
"${BASEDIR}/bin/benchmark-hornetq" $*
"${BASEDIR}/bin/benchmark-rabbitmq" $*
export SKIP_REPORT=
"${BASEDIR}/bin/benchmark-report" $*
67 changes: 67 additions & 0 deletions bin/benchmark-apollo
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash
#
# This shell script automates running the jms-benchmark [1] against the
# Apache Apollo project [2].
#
# [1]: http://github.com/chirino/stomp-benchmark
# [2]: http://activemq.apache.org/apollo
#

true \
${APOLLO_VERSION:=1.0-beta6} \
${APOLLO_DOWNLOAD:="http://archive.apache.org/dist/activemq/activemq-apollo/${APOLLO_VERSION}/apache-apollo-${APOLLO_VERSION}-unix-distro.tar.gz"}

BASEDIR=`dirname "$0"`/.. ; cd "${BASEDIR}" ; BASEDIR=`pwd` ; cd - > /dev/null
. ${BASEDIR}/bin/benchmark-setup

#
# Install the apollo distro
#
APOLLO_HOME="${WORKSPACE}/apache-apollo-${APOLLO_VERSION}"
if [ ! -d "${APOLLO_HOME}" ]; then
cd ${WORKSPACE}
wget "$APOLLO_DOWNLOAD"
tar -zxvf apache-apollo-*.tar.gz
rm -rf apache-apollo-*.tar.gz
fi

APOLLO_BASE="${WORKSPACE}/apollo-${APOLLO_VERSION}"
if [ ! -d "${APOLLO_BASE}" ]; then
cd "${WORKSPACE}"
"${APOLLO_HOME}/bin/apollo" create "apollo-${APOLLO_VERSION}"
fi

#
# Cleanup preious executions.
killall -9 java erl epmd apollo > /dev/null 2>&1
rm -rf ${APOLLO_BASE}/data/* ${APOLLO_BASE}/tmp/* ${APOLLO_BASE}/log/*

#
# Configuration
export JVM_FLAGS="-server -Xmx4G -Xms1G"

#
# Start the server
CONSOLE_LOG="${REPORTS_HOME}/apollo-${APOLLO_VERSION}.log"
"${APOLLO_BASE}/bin/apollo-broker" run > "${CONSOLE_LOG}" 2>&1 &
APOLLO_PID=$!
echo "Started Apollo with PID: ${APOLLO_PID}"
sleep 5
cat "${CONSOLE_LOG}"

#
# Run the benchmark
#
cd "${BASEDIR}/jms-benchmark-stomp"
export CLASSPATH=`mvn dependency:build-classpath | grep -v "\["`
export CLASSPATH="${CLASSPATH}:target/classes"
benchmark --provider stomp --display-errors --url tcp://localhost:61613 --user-name admin --password password "${REPORTS_HOME}/apollo-${APOLLO_VERSION}-stomp.json"
echo ${BENCHMARK_COMMAND}
${BENCHMARK_COMMAND}

#
# Kill the server
kill -9 ${APOLLO_PID}

# Create a report.
"${BASEDIR}/bin/benchmark-report" $*
87 changes: 87 additions & 0 deletions bin/benchmark-hornetq
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/bin/bash
#
# This shell script automates running the stomp-benchmark [1] against the
# HornetQ project [2].
#
# [1]: http://github.com/chirino/stomp-benchmark
# [2]: http://www.jboss.org/hornetq
#

true \
${HORNETQ_VERSION:=2.2.5.Final} \
${HORNETQ_DOWNLOAD:="http://downloads.jboss.org/hornetq/hornetq-${HORNETQ_VERSION}.tar.gz"}

BASEDIR=`dirname "$0"`/.. ; cd "${BASEDIR}" ; BASEDIR=`pwd` ; cd - > /dev/null
. ${BASEDIR}/bin/benchmark-setup

#
# Install the distro
#
HORNETQ_HOME="${WORKSPACE}/hornetq-${HORNETQ_VERSION}"
if [ ! -d "${HORNETQ_HOME}" ]; then
cd ${WORKSPACE}
wget "$HORNETQ_DOWNLOAD"
tar -zxvf hornetq-${HORNETQ_VERSION}.tar.gz
rm -rf hornetq-${HORNETQ_VERSION}.tar.gz

# Adjust the start script so that it execs java.
perl -pi -e 's|^java|exec java|' "${HORNETQ_HOME}/bin/run.sh"
perl -pi -e 's|-Xms512M -Xmx1024M|-Xmx4G -Xms1G|' "${HORNETQ_HOME}/bin/run.sh"

#
# Add the stomp connector to the configuration.
perl -pi -e 's| <\/acceptors>|<acceptor name="stomp-acceptor">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
<param key="protocol" value="stomp"/>
<param key="host" value="0.0.0.0"/>
<param key="port" value="61613"/>
</acceptor>
<\/acceptors>|' "${HORNETQ_HOME}/config/stand-alone/non-clustered/hornetq-configuration.xml"

#
# Add the destinations that the benchmark will be using.
DESTINATION_CONFIGS="<queue name=\"load_me_up-0\"><entry name=\"/queue/load_me_up-0\"/></queue>"
for (( i=0; i < 10 ; i++)) ; do
DESTINATION_CONFIGS="${DESTINATION_CONFIGS}
<queue name=\"loadq-${i}\"><entry name=\"/queue/loadq-${i}\"/></queue>"
done
for (( i=0; i < 10 ; i++)) ; do
DESTINATION_CONFIGS="${DESTINATION_CONFIGS}
<topic name=\"loadt-${i}\"><entry name=\"/topic/loadt-${i}\"/></topic>"
done
perl -pi -e "s|^</configuration>|${DESTINATION_CONFIGS}</configuration>|" "${HORNETQ_HOME}/config/stand-alone/non-clustered/hornetq-jms.xml"

fi

#
# Cleanup preious executions.
killall -9 java erl epmd apollo > /dev/null 2>&1
rm -rf "${HORNETQ_HOME}/data/*" "${HORNETQ_HOME}/logs/*"

#
# Start the server
#
CONSOLE_LOG="${REPORTS_HOME}/hornetq-${HORNETQ_VERSION}.log"
rm "${CONSOLE_LOG}" 2> /dev/null
cd "${HORNETQ_HOME}/bin"
./run.sh > "${CONSOLE_LOG}" 2>&1 &
HORNETQ_PID=$!
echo "Started HornetQ with PID: ${HORNETQ_PID}"
sleep 5
cat "${CONSOLE_LOG}"

#
# Run the benchmark
#
cd "${BASEDIR}/jms-benchmark-hornetq"
export CLASSPATH=`mvn dependency:build-classpath | grep -v "\["`
export CLASSPATH="${CLASSPATH}:target/classes"
benchmark --provider org.fusesource.jmsbenchmark.HornetQScenario --display-errors --url tcp://localhost:5445 "${REPORTS_HOME}/hornetq-${HORNETQ_VERSION}-core.json"
echo ${BENCHMARK_COMMAND}
${BENCHMARK_COMMAND}

# Kill the server
kill -9 ${HORNETQ_PID}

# Create a report.
"${BASEDIR}/bin/benchmark-report" $*
103 changes: 103 additions & 0 deletions bin/benchmark-rabbitmq
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#!/bin/bash
#
# This shell script automates running the stomp-benchmark [1] against the
# RabbitMQ project [2].
#
# [1]: http://github.com/chirino/stomp-benchmark
# [2]: http://www.rabbitmq.com/
#

echo ==================================================================
echo A JMS benchmark has not been setup of RabbitMQ yet as it does not
echo officially support JMS. Perhaps we should benchmark it with the
echo qpid or openamq JMS over AMQP clients.
echo ==================================================================
exit 0

true \
${RABBITMQ_VERSION:=2.7.0} \
${RABBITMQ_DOWNLOAD:="http://www.rabbitmq.com/releases/rabbitmq-server/v${RABBITMQ_VERSION}/rabbitmq-server-generic-unix-${RABBITMQ_VERSION}.tar.gz"}

BASEDIR=`dirname "$0"`/.. ; cd "${BASEDIR}" ; BASEDIR=`pwd` ; cd - > /dev/null
. ${BASEDIR}/bin/benchmark-setup

which erl > /dev/null
if [ $? -ne 0 ] ; then
cd "${WORKSPACE}"
which erl > /dev/null
if [ $? -ne 0 ] ; then
# Lets install erlang..
if [ ! -f "${WORKSPACE}/erlang/bin/erl" ] ; then
# Download it...
if [ ! -d "${WORKSPACE}/otp_src_R14B04" ] ; then
wget http://www.erlang.org/download/otp_src_R14B04.tar.gz
tar -zxvf otp_src_R14B04.tar.gz
rm otp_src_R14B04.tar.gz
fi

# Need the GCC toolchain to build erlang
which yum > /dev/null && sudo yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
which apt-get > /dev/null && sudo apt-get install -y build-essential ncurses-dev libssl-dev

cd "${WORKSPACE}/otp_src_R14B04"
./configure --with-ssl --prefix="${WORKSPACE}/erlang"
make install
fi
export PATH="${WORKSPACE}/erlang/bin:${PATH}"
fi
fi

#
# Install the distro
#
RABBITMQ_HOME="${WORKSPACE}/rabbitmq_server-${RABBITMQ_VERSION}"
if [ ! -d "${RABBITMQ_HOME}" ]; then
cd ${WORKSPACE}
wget "$RABBITMQ_DOWNLOAD"
tar -zxvf rabbitmq-server-generic-unix-${RABBITMQ_VERSION}.tar.gz
rm -rf rabbitmq-server-generic-unix-${RABBITMQ_VERSION}.tar.gz
fi

RABBITMQ_BASE="${WORKSPACE}/rabbitmq-${RABBITMQ_VERSION}"
mkdir -p "${RABBITMQ_BASE}"

#
# Cleanup preious executions.
killall -9 java erl epmd apollo > /dev/null 2>&1
rm -rf "${RABBITMQ_BASE}/*"

#
# Rabbit config
export RABBITMQ_NODENAME=rabbit
export RABBITMQ_SERVER_ERL_ARGS=
export RABBITMQ_CONFIG_FILE="${RABBITMQ_BASE}/config"
export RABBITMQ_LOG_BASE="${RABBITMQ_BASE}/logs"
export RABBITMQ_MNESIA_BASE="${RABBITMQ_BASE}/mnesia"
export RABBITMQ_ENABLED_PLUGINS_FILE="${RABBITMQ_BASE}/plugins"
export RABBITMQ_SERVER_START_ARGS=

#
# Start the server
#s
CONSOLE_LOG="${REPORTS_HOME}/rabbitmq-${RABBITMQ_VERSION}.log"
"${RABBITMQ_HOME}/sbin/rabbitmq-plugins" enable rabbitmq_stomp
"${RABBITMQ_HOME}/sbin/rabbitmq-server" > "${CONSOLE_LOG}" 2>&1 &
RABBITMQ_PID=$!
echo "Started RabbitMQ with PID: ${RABBITMQ_PID}"
sleep 5
cat "${CONSOLE_LOG}"

#
# Run the benchmark
#
cd "${BASEDIR}/jms-benchmark-stomp"
export CLASSPATH=`mvn dependency:build-classpath | grep -v "\["`
export CLASSPATH="${CLASSPATH}:target/classes"
benchmark --provider stomp --display-errors --url tcp://localhost:61613 --login guest --passcode guest "${REPORTS_HOME}/rabbitmq-${RABBITMQ_VERSION}.json"

# Kill the server
kill -9 ${RABBITMQ_PID}
killall -9 epmd

# Create a report.
"${BASEDIR}/bin/benchmark-report" $*
Loading

0 comments on commit a3bf4dd

Please sign in to comment.