• This repository has been archived on 30/Oct/2020
  • Stars
    star
    235
  • Rank 167,480 (Top 4 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated over 8 years ago

Reviews

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

Repository Details

Automated message queue orchestration for scaled-up benchmarking.

Flotilla

Flotilla is a work-in-progress tool for testing message queues in more realistic environments. Many benchmarks only measure performance characteristics on a single machine, sometimes with producers and consumers in the same process even. The reality is this information is marginally useful, if at all, and often deceiving. This blog post provides some more background on the motivation behind this project.

Testing anything at scale can be difficult to achieve in practice. It generally takes a lot of resources and often requires ad hoc solutions. Flotilla attempts to provide automated orchestration for benchmarking message queues in scaled-up configurations. Simply put, we can benchmark a message broker with arbitrarily many producers and consumers distributed across arbitrarily many machines with a single command.

flotilla-client \
    --broker=kafka \
    --host=192.168.59.100:9500 \
    --peer-hosts=localhost:9500,192.168.59.101:9500,192.168.59.102:9500,192.168.59.103:9500 \
    --producers=5 \
    --consumers=3 \
    --num-messages=1000000
    --message-size=5000

In addition to simulating more realistic testing scenarios, Flotilla also tries to offer more statistically meaningful results in the benchmarking itself. It relies on HDR Histogram (or rather a Go variant of it) which supports recording and analyzing sampled data value counts at extremely low latencies. See the "Caveats" section below for potential benchmarking issues and areas for improvement.

Flotilla supports several message brokers out of the box:

Installation

Flotilla consists of two binaries: the server daemon and client. The daemon runs on any machines you wish to include in your tests. The client orchestrates and executes the tests. Note that the daemon makes use of Docker for running many of the brokers, so it must be installed on the host machine. If you're running OSX, use boot2docker.

To install the daemon, run:

$ go get github.com/tylertreat/flotilla/flotilla-server

To install the client, run:

$ go get github.com/tylertreat/flotilla/flotilla-client

Usage

Ensure the daemon is running on any machines you wish Flotilla to communicate with:

$ flotilla-server
Flotilla daemon started on port 9500...

Local Configuration

Flotilla can be run locally to perform benchmarks on a single machine. First, start the daemon with flotilla-server. Next, run a benchmark using the client:

$ flotilla-client --broker=rabbitmq

Flotilla will run everything on localhost.

Distributed Configuration

With all daemons started, run a benchmark using the client and provide the peers you wish to communicate with:

$ flotilla-client --broker=rabbitmq --host=<ip> --peer-hosts=<list of ips>

For full usage details, run:

$ flotilla-client --help

Running on OSX

Flotilla starts most brokers using a Docker container. This can be achieved on OSX using boot2docker, which runs the container in a VM. The daemon needs to know the address of the VM. This can be provided from the client using the --docker-host flag, which specifies the host machine (or VM, in this case) the broker will run on.

$ flotilla-client --broker=rabbitmq --docker-host=$(boot2docker ip)

Caveats

  • Not all brokers are created equal. Flotilla is designed to make it easy to test drive different messaging systems, but comparing results between them can often be misguided.
  • Several brokers support publishing batches of messages to boost throughput (with a latency penalty). Some brokers don't support batching, so messages are published one at a time for these. This affects throughput significantly.
  • The latency of a message is measured as the time it's sent subtracted from the time it's received. This requires recording the clocks of both the sender and receiver. If you're running scaled-up, distributed tests, then the clocks aren't perfectly synchronized. These benchmarks aren't perfect.
  • Related to the above point, measuring anything requires some computational overhead, which affects results. HDR Histogram tries to minimize this problem but can't remove it altogether.
  • There is currently no security built in. Use this tool at your own risk. The daemon runs on port 9500 by default.

TODO

  • Many message brokers, such as Kafka, are designed to operate in a clustered configuration for higher availability. Add support for these types of topologies. This gets us closer to what would be deployed in production.
  • Some broker clients provide back-pressure heuristics. For example, NATS allows us to slow down publishing if it determines the receiver is falling behind. This greatly improves throughput.
  • Replace use of os/exec with Docker REST API (how does this work with boot2docker?)
  • Plottable data output.
  • Integration with Comcast for testing under different network conditions.
  • Use etcd to provide shared configuration and daemon discovery
  • Use usl to populate a Universal Scalability Law model
  • Use tinystat to compare benchmark runs and tease out statistical noise

More Repositories

1

comcast

Simulating shitty network connections so you can build better systems.
Go
10,227
star
2

BoomFilters

Probabilistic data structures for processing continuous, unbounded streams.
Go
1,580
star
3

chan

Pure C implementation of Go channels.
Shell
1,395
star
4

BigQuery-Python

Simple Python client for interacting with Google BigQuery.
Python
449
star
5

bench

A generic latency benchmarking library.
Go
305
star
6

mq-benchmarking

Performance benchmarks for various message queues.
Go
191
star
7

CS-Literature-of-the-Day

A curated list of computer science literature, updated daily.
163
star
8

go-benchmarks

A few miscellaneous Go microbenchmarks.
Go
146
star
9

fast-topic-matching

Messaging middleware topic matching implementations.
Go
73
star
10

nanomsg-service-discovery

Service-discovery pattern implemented with nanomsg.
Python
25
star
11

gatling

Minimal pub/sub message queue in C.
C
20
star
12

Zinc

Real-time distributed messaging and document synchronization.
Java
15
star
13

InverseBloomFilter

Concurrent inverse Bloom filter.
Go
13
star
14

PubSub-Python

Simple Python client for interacting with Google Cloud Pub/Sub.
Python
9
star
15

log-benchmarking

Benchmarking for distributed logs.
Go
9
star
16

thrift-nats

Thrift RPC over NATS.
Go
8
star
17

go-fast

Material for 'So You Wanna Go Fast?' Strange Loop talk
Go
8
star
18

OpenGL-Playground

Playing with OpenGL.
C
7
star
19

go-zab

Go implementation of ZooKeeper Atomic Broadcast.
Go
7
star
20

Dalvik-Baksmali

Android library for disassembling DEX files using baksmali.
Java
7
star
21

nats-leader-election

Leader election implemented with Raft over NATS.
Go
6
star
22

hdrhistogram-writer

API for writing HdrHistograms in a readable format consumable by http://hdrhistogram.github.io/HdrHistogram/plotFiles.html.
Go
6
star
23

httpmonitor

CLI tool for monitoring HTTP traffic.
Go
5
star
24

kaput.io

Laws of General Systemantics.
CSS
5
star
25

sync

Some basic synchronization primitives.
C
4
star
26

rdcss

RDCSS double-compare-single-swap.
Go
4
star
27

dockerfiles

Contain yourself.
Shell
3
star
28

gae-circleci-java

Example Java Spring app running on Google App Engine deployed from CircleCI.
Java
2
star
29

uthread

C
2
star
30

dexmaker

Java
2
star
31

gatling-gun

Go client for gatling broker.
Go
2
star
32

matchboxd

Replicated matchbox server (https://github.com/Workiva/matchbox)
Go
2
star
33

vessel

Fast, asynchronous client-server messaging.
Go
2
star
34

SQLAlchemyUtils

Useful utilities for working with SQLAlchemy.
Python
2
star
35

TrendBlotter

The world talks, we listen.
JavaScript
2
star
36

vessel.js

Vessel messaging client.
JavaScript
2
star
37

gaeutils

Useful utilities for working with Google App Engine.
Python
1
star
38

crapchat

A janky and obnoxious chat application.
Go
1
star
39

Jockey

Seamless Google App Engine authentication for Android.
Java
1
star
40

type-ahead-search

Toy type-ahead search.
Java
1
star
41

nimbus

Nim
1
star
42

zk-select

Go
1
star
43

dotfiles

The most exciting thing you will ever see.
Vim Script
1
star
44

pipe-sem

C
1
star
45

webhook-test

webhook test
Python
1
star
46

jump-consistent-hash

Go implementation of Jump Consistent Hash.
Go
1
star
47

config-parser

A simple API for parsing ini-like configuration files.
1
star