First checkout latest version of this repository on all machines
test -e ~/src/tomcat-bench || git clone https://github.com/tgrabiec/tomcat-bench ~/src/tomcat-bench
cd ~/src/tomcat-bench
git fetch
git checkout -f ${TOMCAT_BENCHMARK_VERSION_REF:-origin/master}Run
./setup-host.shTODO: Describe how to prepare base fedora image
Start your fedora image:
cd ~/src/osv
sudo scripts/run.py -m2g -nv -b bridge0 -i ~/fedora/fedora.img
GUEST_IP=10.0.0.176Upload tomcat deployment to fedora guest
cd apps/tomcat/upstream
zip -r tomcat.zip apache-tomcat-7.0.42/
scp tomcat.zip root@${GUEST_IP}:~Perform the following steps in fedora guest.
Unzip the package:
$ cd ~
$ rm -rf apache-tomcat-*/
$ unzip tomcat.zip
$ ln -s apache-tomcat-7.0.42 tomcatCreate init script and shutdown:
$ cd /etc/init.d
$ cat > tomcat
#!/bin/bash
set -e
case $1 in
'start')
export JAVA_OPTS="-Xmx2g -Xms2g"
cd /root/tomcat/bin
./startup.sh 2>&1 > /var/log/tomcat.log < /dev/null &
;;
esac
$ chmod +x tomcat
$ cd ../rc3.d
$ ln -s ../init.d/tomcat S99tomcat
$ shutdown nowSave image backup
cp ~/fedora/fedora.img ~/fedora/fedora.img.original Run
sudo ./setup.shRestore image from the backup and start the guest. It is important to do it before each test because the guest file system fills up very quickly. If the image was not restored the consecutive samples would not be independent.
For OSv:
cd ~/src/osv
cp usr.img.original build/release/usr.img && \
sudo scripts/run.py -m4g -nv -b bridge0For Fedora:
cp ~/fedora/fedora.img.original ~/fedora/fedora.img && \
sudo scripts/run.py -m4g -nv -b bridge0 -i ~/fedora/fedora.imgRead the IP of OSv and assign to GUEST_IP variable on load driver machine.
Start the test on load driver machine:
./perform-one-test.shKill the guest.
Restore system configuration on load driver machine
cd ~/src/tomcat-bench
sudo ./restore_sys_conf.sh
rm ./restore_sys_conf.shHost:
cd ~/src/osv
echo OSV_VERSION=$(scripts/osv-version.sh)
cd apps
echo APPS_VERSION=$(git rev-parse HEAD)cd ~/src/FrameworkBenchmarks
echo TEST_APP_VERSION=$(git rev-parse HEAD)echo QEMU_VERSION=$(qemu-system-x86_64 -version | sed -r 's/.*version ([0-9.]+).*/\1/')Load driver:
cd ~/src/tomcat-bench
echo BENCHMARK_VERSION=$(git rev-parse HEAD)