-
Notifications
You must be signed in to change notification settings - Fork 40
Running perfrunner locally
This is a description on how to run perfrunner tests without Internet connectivity once everything is setup properly.
As this takes a while, start with starting the VMs that will have the Couchbase nodes installed to run the perfrunner test against.
Checkout our vagrant recipes:
git clone https://github.com/couchbaselabs/vagrants.git
Start the VMs:
cd vagrants/3.0.2/ubuntu12
VAGRANT_NODES=4 vagrant up
Once they are up and running slight changes are needed to make the work for perfrunner.
Perfrunner currently needs to have a root account setup. As it normally uses "couchbase" as password, we'll do the same:
The password of the vagrant user is "vagrant". Enter "couchbase" when you're asked for the new password:
for i in 1 2 3 4; do ssh [email protected]${i} 'sudo passwd root'; done
On my machine it took about 15s to get the SSH prompts, so be partient.
Next we try out if the newly setup root account works properly and installing additional packages. Hence the password you are prompted for is this time "couchbase":
for i in 1 2 3 4; do ssh [email protected]${i} 'apt-get -y install numactl sysstat atop'; done
That's all that's needed for the virtual machines.
Perfrunner consists of several pieces and some need to be patched as the changes are not merged upstream yet.
git clone https://github.com/couchbase/perfrunner.git
cd perfrunner
make build
cd ..
Seriesly is used to store the metrics when they are collected.
GOPATH=`pwd`/seriesly go get github.com/dustin/seriesly
seriesly/bin/seriesly
cbmonitor is used to store and manage the final test output. The make
step will take a while, grab a coffee.
git clone https://github.com/couchbase/cbmonitor.git
make
make run
The make run will guide you through the initial setup. The exact username doesn't matter, feel free to choose any.
In case your virtual machines are not running anymore, start them up again with:
VAGRANT_NODES=4 vagrant up
Go to the directory where you've setup the perfrunner environment and start seriesly:
cd seriesly
bin/seriesly
In a separate terminal start cbmonitor
cd cbmonitor
make run
Setup the cluster for a specific test you want to run:
cd perfrunner
./env/bin/python -m perfrunner.utils.cluster -c clusters/vagrant.spec -t tests/<your-test> \ "clusters.vagrant.\"192.168.105.101:8091 192.168.105.102:8091 192.168.105.103:8091 192.168.105.104:8091\""
Run the actual test:
./env/bin/python -m perfrunner -c clusters/vagrant.spec -t <your-test-file> --local --nodebug "stats.cbmonitor_host.\"localhost:8000\",stats.seriesly_host.\"localhost\",clusters.vagrant.\"192.168.105.101:8091 192.168.105.102:8091 192.168.105.103:8091 192.168.105.104:8091\""
Once you've run a test and want to run another one, you need to clean it up. This one-liner will do it:
for i in 1 2 3 4; do ssh [email protected]${i} '/etc/init.d/couchbase-server stop ; rm -f rm /opt/couchbase/var/lib/couchbase/ip*; rm -f /opt/couchbase/var/lib/couchbase/config/config.dat ; rm -rf /opt/couchbase/var/lib/couchbase/data/ ; /etc/init.d/couchbase-server start'; done