Giter VIP home page Giter VIP logo

kafka-poor-man-benchmarker's Introduction

Kafka poor man's benchmarker

The poor man's benchmarker is a set of pyton script and java code to benchmark different kafka configuration and generate graphs from the result. It's composed of two utilities

  • python bench.py: An utility to start benchmarking Kafka
  • python graph.py: An utility to render graphs from the benchmark results

Installation

The following application need to be available in your path as a prerequisites:

  • gcc: Requirement for matplotlib
  • python-devel: Requirement for matplotlib
  • pip: To install all required libraries
  • kafka-topics: Used in the benchmarker to create and delete topic
  • maven: Used to build the java driver

To install the required libraries in python, please execute:

pip install -r requirements.txt

To compile the java driver, please execute:

(cd java/driver && mvn package)

Benchmarking

# Sequentially execute all test in the "properties" directory
python bench.py

# Execute the tests provided 
python bench.py <test1.json> <test2.json>

Plot results

# Render a graph of the result
# Note: You need to have a user interface running (e.g. X11)
python graph.py <result.out> 

Configuration

Global configuration and properties are available in the configuration.json file. If you need to configure different properties for the KafkaConsumer or KafkaProducer (e.g. TLS configuration, Authentication, etc...), put all the required properties in this file in a JSON format. Note: the bootstrap.servers is a required attributes. Example of configuration:

{
  "bootstrap.servers": "localhost:9092"
}

Writing tests

Test has to be written in JSON and the following keys are required:

  • test: name of the test to execute, ensure that your name is unique as the result will be written in a file named .out
  • type: either producer, to test KafkaProducer, or consumer, to test KafkaConsumer
  • properties: containing all the properties that need to be specified for KafkaProducer or KafkaConsumer

You could use an array in property value, in this case all different combination of value will be tested by the benchmarker. For example, if you specify { a: [1, 2], b: [1, 2]}, the following tests would be performed: {a: 1, b: 1}, {a: 1, b: 2}, {a: 2, b: 1} and {a: 2, b: 2}.

{
  "test": "batchsizeandlinger",
  "type": "producer",
  "properties": {
    "linger.ms": [1,2,3,4,5,6,7,8,9,10],
    "batch.size": [1024,8192,16384,32768,65536,131072,262144,307200,409600,524288,624288,624288,724288,824288,924288,1048576]
  }
}

Output

Impact of compression in producer

Impact of max.fetch.bytes in consumer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.