• Stars
    star
    310
  • Rank 129,966 (Top 3 %)
  • Language
    Erlang
  • License
    Apache License 2.0
  • Created almost 14 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A load-generation and testing tool for basically whatever you can write a returning Erlang function for.

basho_bench

Overview

Travis-CI :: https://secure.travis-ci.org/basho/basho_bench.png

Additional documentation on docs.basho.com

Basho Bench is a benchmarking tool created to conduct accurate and repeatable performance tests and stress tests, and produce performance graphs.

Originally developed to benchmark Riak, it exposes a pluggable driver interface and has been extended to serve as a benchmarking tool across a variety of projects.

Basho Bench focuses on two metrics of performance:

  • Throughput: number of operations performed in a timeframe, captured in aggregate across all operation types
  • Latency: time to complete single operations, captured in quantiles per-operation

Quick Start

You must have Erlang/OTP R16 or later to build and run Basho Bench, and R to generate graphs of your benchmarks. A sane GNU-style build system is also required if you want to use make to build the project.

git clone git://github.com/basho/basho_bench.git
cd basho_bench
make all

This will build an executable script, basho_bench, which you can use to run one of the existing benchmark configurations from the examples/ directory. You will likely have to make some minor directory changes to the configs in order to get the examples running (see, e.g., the source of the bitcask and innostore benchmark config files for direction).

$ ./basho_bench examples/riakc_pb.config
INFO: Est. data size: 95.37 MB
INFO: Using target ip {127,0,0,1} for worker 1
INFO: Starting max worker: <0.55.0>

At the end of the benchmark, results will be available in CSV format in the tests/current/ directory. Now you can generate a graph:

$ make results
priv/summary.r -i tests/current
Loading required package: proto
Loading required package: reshape
Loading required package: plyr
Loading required package: digest
null device 
          1 
$ open tests/current/summary.png

Troubleshooting Graph Generation

If make results fails with the error /usr/bin/env: Rscript --vanilla: No such file or directory please edit priv/summary.r and replace the first line with the full path to the Rscript binary on your system

If you receive the error message Warning: unable to access index for repository http://lib.stat.cmu.edu/R/CRAN/src/contrib it means the default R repo for installing additional packages is broken, you can change it as follows:

$ R
> chooseCRANmirror()
Selection: 69
quit()
make results

Customizing your Benchmark

Basho Bench has many drivers, each with its own configuration, and a number of key and value generators that you can use to customize your benchmark. It is also straightforward โ€“ with less than 200 lines of Erlang code โ€“ to create custom drivers that can exercise other systems or perform custom operations. These are covered more in detail in the documentation.

Benchmarking with riak-java-client

The riak-java-client can be used to benchmark a Riak cluster. There is an example configuration in examples/riakc_java.config. You will need the bench_shim project. You will also need to uncomment and edit the following line in basho_benchโ€™s rebar.config, adding your own erlang cookie value:

%% {escript_emu_args, "%%! -name [email protected] -setcookie YOUR_ERLANG_COOKIE\n"}.

Alternative Graph Generation by gnuplot

You can generate graphs using gnuplot.

$ ./priv/gp_throughput.sh
$ ./priv/gp_latencies.sh

By passing -h option to each script, help messages are shown.

Some of options for these scripts are:

  • -d TEST_DIR : comma separated list of directories which include test result CSV files
  • -t TERMINAL_TYPE : gnuplot terminal type
  • -P : just print gnuplot script without drawing graph

For example, you can draw graphs with ASCII characters by the option -t dumb, which is useful in non-graphical environment or quick sharing of result in chat.

Also, you can plot multiple test runs on a single plot by using โ€œ-dโ€ switch.

Benchmarking Erlang cluster

A typical benchmark scenario is that Basho Bench spawn Erlang VM and executes the driver inside. However, there is needs to catch performance metrics from an application executed remotely within dedicated environment (e.g. probe performance from live system; benchmark an application inside C or Java node, etc). Bash Bench implements a generic basho_bench_driver_cluster that acts as proxy. It uses Erlang distribution to delegate benchmark responsibility to remote actor, which is randomly selected from configured pool.

Basho Bench do not define how the actors are spawned within SUT. It only defined a communication protocol. The actor is responsible to handle the message:

{pid(), atom(), key(), val()}

  • pid() : request originator, actor shall respond to this process
  • atom() : id of operation to execute as defined in config file
  • key() : materialized key value as defined by key generator function
  • val() : materialized value as defined by value generator function

The actor executes the request, measures performance and respond to originator process pid() with one of the message {ok, microsecond()} or {error, reason()}

See cluster.config example for details. Use following command to spawn benchmark

./basho_bench -C nocookie -N [email protected] -J [email protected] examples/cluster.config

Contributing

We encourage contributions to Basho Bench from the community.

  1. Fork the basho_bench repository on Github.
  2. Clone your fork or add the remote if you already have a clone of the repository.
    git clone [email protected]:yourusername/basho_bench.git
    # or
    git remote add mine [email protected]:yourusername/basho_bench.git
        
  3. Create a topic branch for your change.
    git checkout -b some-topic-branch
        
  4. Make your change and commit. Use a clear and descriptive commit message, spanning multiple lines if detailed explanation is needed.
  5. Push to your fork of the repository and then send a pull-request through Github.
    git push mine some-topic-branch
        
  6. A Basho engineer or community maintainer will review your patch and merge it into the main repository or send you feedback.

More Repositories

1

riak

Riak is a decentralized datastore from Basho Technologies.
Shell
3,841
star
2

riak_core

Distributed systems infrastructure used by Riak.
Erlang
1,185
star
3

bitcask

because you need another a key/value storage engine
Erlang
1,179
star
4

rebar

ATTENTION: Please find the canonical repository here:
Erlang
1,070
star
5

riak_kv

Riak Key/Value Store
Erlang
633
star
6

riak_cs

Riak CS is simple, available cloud storage built on Riak.
Erlang
564
star
7

leveldb

Clone of http://code.google.com/p/leveldb/
C++
408
star
8

erlang_protobuffs

An implementation of Google's Protocol Buffers for Erlang, based on ngerakines/erlang_protobuffs.
Erlang
390
star
9

riak_dt

Convergent replicated datatypes in Erlang
Erlang
346
star
10

riak-python-client

The Riak client for Python.
Python
324
star
11

riak-erlang-client

The Riak client for Erlang.
Erlang
312
star
12

eleveldb

Erlang LevelDB API
C++
266
star
13

riak-java-client

The Riak client for Java.
Java
264
star
14

yokozuna

Riak + Solr
Erlang
247
star
15

erlang_js

A linked-in driver for Erlang to Mozilla's Spidermonkey Javascript runtime.
Erlang
238
star
16

riak-ruby-client

The Riak client for Ruby.
Ruby
233
star
17

cuttlefish

never lose your childlike sense of wonder baby cuttlefish, promise me?
Erlang
205
star
18

basho_docs

Basho Products Documentation
SCSS
169
star
19

riak_ensemble

Multi-Paxos framework in Erlang
Erlang
166
star
20

riak-php-client

PHP clients for Riak
PHP
163
star
21

riak_pipe

Riak Pipelines
Erlang
162
star
22

clique

CLI Framework for Erlang
Erlang
144
star
23

riak_search

Full-text search engine based on Riak
Erlang
141
star
24

riak_control

Webmachine-based administration interface for Riak.
CSS
136
star
25

machi

Machi file store
Erlang
122
star
26

enm

Erlang driver for nanomsg
Erlang
120
star
27

sidejob

Parallel worker and capacity limiting library for Erlang
Erlang
103
star
28

riak-go-client

The Riak client for Go.
Go
90
star
29

node_package

RPM/Debian/FreeBSD/SmartOS/Solaris/OSX packaging templates for Erlang Nodes
Shell
90
star
30

merge_index

MergeIndex is an Erlang library for storing ordered sets on disk. It is very similar to an SSTable (in Google's Bigtable) or an HFile (in Hadoop).
Erlang
81
star
31

riak_function_contrib

Riak Function Contrib
Erlang
79
star
32

mochiweb

a branch of Mochi Media's excellent HTTP library -- their canonical source can be found at https://github.com/mochi/mochiweb
Erlang
78
star
33

riak-dotnet-client

The Riak client for .NET
C#
76
star
34

riak_sysmon

Simple OTP app for managing Erlang VM system_monitor event messages
Erlang
74
star
35

riak-nodejs-client

The Riak client for Node.js.
JavaScript
71
star
36

riak_pb

Riak Protocol Buffers Messages
Erlang
70
star
37

riak_test

I'm in your cluster, testing your riaks
Erlang
70
star
38

cluster_info

Fork of Hibari's nifty cluster_info OTP app
Erlang
63
star
39

ebloom

A NIF wrapper around a basic bloom filter.
C++
62
star
40

spark-riak-connector

The official Riak Spark Connector for Apache Spark with Riak TS and Riak KV
Scala
60
star
41

innertube

A thread-safe re-entrant resource pool for Ruby, extracted from the Riak Ruby Client.
Ruby
59
star
42

lager_syslog

Syslog backend for lager
Erlang
59
star
43

riaknostic

A diagnostic tool for Riak installations, to find common errors asap
Erlang
58
star
44

riaktant

A node.js sample app that stores syslog messages in Riak Search
JavaScript
56
star
45

riak_repl

Riak DC Replication
Erlang
55
star
46

giddyup

Visual scorecard for riak_test.
JavaScript
54
star
47

riak-erlang-http-client

Riak Erlang client using the HTTP interface
Erlang
48
star
48

riak_crdt_cookbook

A Cookbook full of Tutorials to get Developers started with Riak's CRDTs
Erlang
42
star
49

riak_err

Enhanced SASL Error Logger for Riak
Erlang
36
star
50

riak-hadoop

Riak data as input to hadoop m/r and output of hadoop m/r
Java
33
star
51

cloudformation-riak

Create Riak clusters with AWS CloudFormation
32
star
52

innostore

Innostore is a simple Erlang API to Embedded InnoDB.
C
31
star
53

riak_ql

SQL query language for Riak
Erlang
30
star
54

riak_api

Riak Client APIs
Erlang
27
star
55

taste-of-riak

Source code for all the taste of riak examples
C#
22
star
56

luke

Dataflow / MapReduce coordination framework.
Erlang
22
star
57

basho_metrics

Fast performance metrics for Erlang
C++
21
star
58

skerl

Skein hash function for Erlang, via NIFs
C
19
star
59

stanchion

Stanchion is an application to enforce the serialization of requests for Riak CS.
Erlang
16
star
60

dactyl

String templating library for Erlang
Erlang
16
star
61

jam

Erlang time/date processing
Erlang
16
star
62

faulterl

Erlang glue & control code for dynamic library-level fault injection
C++
15
star
63

tools.mk

A small makefile library for working with erlang tools
Makefile
14
star
64

nifwait

Utility to test effect of blocking NIFs on Erlang scheduler
Erlang
14
star
65

rebar_raw_resource

A rebar3 resource wrapper to accommodate non-OTP-app dependencies
Erlang
14
star
66

columbo

Columbo - the dependency detective - will highlight 3rd party dependency problems in your Erlang programs.
Erlang
14
star
67

canola

Simple PAM port driver for erlang
C
12
star
68

bashubot

Our own little hubot.
CoffeeScript
11
star
69

riak_cs_control

Webmachine-based administration interface for Riak CS.
Erlang
9
star
70

bench_shim

A Jinterface shim between basho_bench and riak-java-client
Java
9
star
71

riak_on_azure

Shell
8
star
72

basho-dtrace

DTrace scripts that Basho Team has found useful
D
8
star
73

riak-client-tools

Tools for Riak Client libraries
Shell
8
star
74

riak-nodejs-client-examples

Riak Node.js Client example code
JavaScript
8
star
75

stableboy

basho_harness VM / Harness provisioner
Erlang
7
star
76

riak_shell

A Repl for Riak
Erlang
7
star
77

riak-phppb-client

Official PHP Protocol Buffers Client for Riak
PHP
7
star
78

bashobot

A friendly little bot for the #riak IRC channel
Ruby
7
star
79

riak-zabbix

A set of tools and templates to help monitor Riak with the Zabbix monitoring tool.
ApacheConf
7
star
80

riak_cs_auth

Authentication schemes for Riak CS
Erlang
6
star
81

systest

Miscellaneous system test scripts
Erlang
6
star
82

casbench

tools for benchmarking cassandra
Erlang
6
star
83

recap-blog

[depreciated] The Riak Recap Blog
6
star
84

zdgrab

Zdgrab is a utility for downloading attachments to tickets from Zendesk.
Python
5
star
85

planet_riak

Riak Planet
Python
5
star
86

riak_cs_core

Core functionality for RIak CS
Erlang
5
star
87

data_platform

Basho Data Platform
Shell
5
star
88

data_platform_core

Basho Data Platform Core
Erlang
5
star
89

riak_auth_mods

Standard interface for security auth modules for Riak
Erlang
5
star
90

riak_cs_web

HTTP APIs for Riak Cloud Storage
Erlang
4
star
91

rfc

JavaScript
4
star
92

cluster_info_browser

In-browser app to easily flip through a cluster_info report
JavaScript
4
star
93

riak_ee-issues

Issue tracking for Riak Enterprise
3
star
94

riak-dotnet-client-api

Riak .NET Client API Documentation
HTML
3
star
95

riak_cs_lfs

Large file support for Riak CS
Erlang
3
star
96

ripple-encryption

Ruby
3
star
97

congruent

Generic test suite for Riak clients
Erlang
3
star
98

riak_cs_multibag

Riak CS Multi-cluster module
Erlang
3
star
99

riak_cs_acl

ACL support for Riak CS
Erlang
3
star
100

riak_cs_report

Reporting functionality for Riak CS
Erlang
3
star