basho_bench for Hibari

Howdy, all. I’ve written a first draft of a basho_bench driver for Hibari. Instructions on how to use it follow.

NOTE: You’ll need Git and Mercurial in order to check out the basho_bench source.

You’ll also need the (very cool) statistics package R installed in order to create basho_bench’s graphs. For CentOS 5 users, I don’t have any good advice, sorry. For Mac OS, once I’d installed MacPorts, I think it was just a matter of “port install R”.

Now make a copy of the example config file: cp examples/hibari.config ./my-hibari.config … and edit it to reflect your local environment. Sorry, I don’t have any extensive documentation on it right now. There is basho_bench- specific documentation in the “docs” subdirectory. All of the Hibari- specific stuff is (hopefully clear?) in the comments of the example config file.

The ‘code_paths’ section of the config will require pointers to a bunch of code directories in the Hibari source. ALSO, there is one patch that you need to install in the …/hibari/src/erl-apps/gmt_util__HEAD directory. Download the patch file and put it in /tmp. The URL is: http://www.snookles.com/scott/hibari/gmt_config.erl.patch

Then apply it and rebuild using: cd /your/path/to/hibari/src/erl-apps/gmt-util__HEAD patch -p1 < /tmp/gmt_config.erl.patch rm .bom* cd ../../../ make

OK, now back to editing “./my-hibari.config”. Hopefully the comments are clear enough for you to figure out what to do. As a first experiment, I suggest that you ignore the “Erlang native client” and instead use the EBF client. Most of the entries in examples/hibari.config are good enough.

I suggest changing ‘duration’ to 1 minute and ‘concurrent’ to something small’ish like 10 (until you’re familiar with the tool). Change the code_paths to reflect where you’ve got the Hibari source. Then change the ‘hibari_servers’ list to point to your server(s). For a single node system, make only one entry in this list. :-)

Now, time to run the tool. ./basho_bench ./my-hibari.config

The output data will go into a local subdirectory called “tests”. When the run is finished, you’ll see something like: =INFO REPORT==== 16-Sep-2010::01:21:31 === application: basho_bench exited: stopped type: permanent Test completed after 1 mins.

The command “make results” will create a graph. The graph is a PNG file that is located in the same directory as the test results. Note that there is a symbolic link in the “tests” subdirectory that points to the most recent test run results. For example, “tests/20100916_012028”. That file can be viewed by most bitmap graphic image viewing utilities; for MacOS, I usually use: open ./tests/current/summary.png

I’ll include a sample config and graph. The config is for a 10 minute run with 100 load generator threads. This isn’t a very good test environment: the server is a small RAM, single disk machine. The basho_bench machine is a MacBook Pro that uses a WiFi network to talk to the server. This is not the kind of environment that you want to try to optimize, so don’t bother trying. This is just meant to be a quickie example, to be emailed before I fall asleep.

Happy hacking!

-Scott

(Click on the image below to see a full-size, hopefully-undistorted image).