Giter Club home page Giter Club logo

benchmark-kafka-go-clients's Introduction

Benchmark of Kafka Go Clients

Benchmark

Benchmark to test different kafka go clients to compare them under the same conditions.

This started as a proof of concept of creating some benchmarks that could run directly on github actions, publishing the results in a dashboard associated with the same repository.

This benchmark has been greatly inspired by Matt Howlett's benchmark. I shamelessly used what it has instead of reading the documentation of the different clients :S.

Clients

The clients tested in this benchmark are:

Setup

In order to run the benchmarks we need the following cli tools installed:

Running

In order to run the benchmark tests we need a working kafka image. In this benchmark I've used docker-based Kafka instances but it's possible to use any kafka.

To run the benchmarks we use the following syntax:

ginkgo -focus=${type} ./... -- -test.bench=. -library=${client} -num=${num-messages} -size=${size-messages} -brokers=${brokers} -topic=${topic}

Type

It can be one of the following:

  • producer: To test the client producers against the kafka brokers selected.
  • consumer: To test the client consumers against the kafka brokers selected.
  • lag: To perform a lag check agains a topic to see if the producer sent all the messages as expected.

The syntax of the lag is slightly different to the other two types.

ginkgo -focus=lag ./... -- -test.bench=. -num=${num-messages} -brokers=${brokers} -topic=${topic}

Where num-messages is the number of messages we would expect to find in that topic.

Client

It can be one of the following:

  • confluent: (producer only). To test the Confluent-kafka-Go producer.
  • confluent-poll: (consumer only). To test the Confluent-kafka-Go polling-based consumer.
  • confluent-channel: (consumer only). To test the Confluent-kafka-Go channel-based (and deprecated) consumer.
  • sarama: To test the Sarama producer/consumer.
  • kafkago: To test the KafkaGo producer/consumer.

Num-Messages

It's an integer specifying the number of messages to produce/consume for the benchmark.

Size-Messages

It's an integer specifying the size of messages to use for the benchmark. In case of the consumers the Kafka instance will be prepopulated with messages of this size to be consumed.

Brokers

Location of the kafka brokers to use for this benchmark. It includes the port. For instance localhost:9092.

Topic

The topic as string to use for this benchmark.

Output

The output of the benchmarks is automatically display in the dashboard. The results are downloaded from the github actions, where are stored as artifacts, and used as sources when building the results dashboard.

If a client doesn't appear in the graph is because the time used in the benchmark is so much higher than I didn't consider it necessary to perform further tests of it.

Thanks

Special thanks to the components that I used for this:

benchmark-kafka-go-clients's People

Contributors

gguridi avatar xujiahua avatar

Watchers

 avatar

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.