Benchmarking CouchDB with Baracus
Baracus is a new project built specifically for benchmarking CouchDB. Using trusty httperf, Baracus makes it easy to create and perform a battery of tests based on simple configuration files. In this post I'll go into the details of a Baracus run and show you how to run your own benchmarks.
First, let's install Baracus. It depends on httperf so install it first either from source (check the README for compile options for httperf) or from your distribution. Note that Baracus uses gemcutter for gem hosting.
gem sources -a http://gemcutter.org
gem install baracus
Next, let's examine a simple Baracus config file.
httperf: "/usr/bin/httperf"
host: "localhost"
port: "5984"
user:
password:
db: "testdb"
report_url: "http://localhost:5984/bench"
name: "test123"
config:
timeout: 30
sessions: 100
rate: 100
doc_size: 100
writes: 10
reads: 10
batchok: false
info:
storage: "raid10, 4 disks, ebs"
anything: "stuff"
more: "foo"
This configuration file specifies where the httperf executable lives, the host, port, user, password, and database to use for the test. Baracus puts all of the results and wsesslog files back into CouchDB for later consumption, the report_url is where you define this database.
As I mentioned, Baracus uses httperf to perform benchmarks. Specifically it uses httperf's wsesslog feature. wsesslog is a simple file format that describes what httperf should do each session. Here's an example of an entry generated with Baracus that does an HTTP GET:
/testdb/a12bf8572f788824dfd5169e2eb496ab method=GET
Baracus creates two wsesslogs for each run, one for writes (POST) and one for reads (GET). Baracus generates these files based on a few items in your configuration. Specifically, the number of sessions, document size and how many reads or writes to do per session. Additionally in the configuration you can specify at what rate httperf should perform the operations within each wsesslog file. Baracus creates the wsesslog for writing with random data and creates the read file with random docs from _all_docs. Since Baracus uses _all_docs, it performs all the writes first. The above config will create 100 sessions with 10 writes and reads each at a rate of 100 per second. Each document will be roughly 100 bytes.
The info section at the end of the config contains any additional information you may want to have tag along with your results. You can put anything you want in there; I generally use this to describe the system I just ran the tests on.
Once you have a configuration you are happy with it's very simple to run your tests.
baracus baracus.yml
This will print the standard httperf output as well as a tab delimited version. If you want to checkout the wsesslog files they will be written to the directory you ran Baracus in as well as to the results document in the reporting database. Here's what the results look like in Couch.

Baracus is meant to make repeatable benchmarking easy. If you have any questions, bugs or would like to contribute check out Baracus on github.