Coder Social home page Coder Social logo

msk-perf-test's Introduction

Notes

All tests were run from Alpine-based Docker container running in Kubernetes Pod on Amazon EKS cluster. The EKS cluster and MSK cluster in separate VPCs, within same AWS Account and AWS Region (us-east-1).

Requirements

  • Case 1: RF=2, acks = 1, min.insync.replicas = 1, nearest replica fetching turned on for consumer, PST not enabled
  • Case 2: RF=3, acks = 1, min.insync.replicas = 1, nearest replica fetching turned on for consumer, PST not enabled
  • 300-500 bytes/message (used 400)
  • 50 MB/s in total
  • 50 * 1024 * 1024 = 52428800 / 400 = 131072 msg/sec

Custom MSK Configuration

auto.create.topics.enable=true
default.replication.factor=3
min.insync.replicas=1
num.io.threads=8
num.network.threads=5
num.partitions=1
num.replica.fetchers=2
replica.lag.time.max.ms=30000
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
socket.send.buffer.bytes=102400
unclean.leader.election.enable=true
zookeeper.session.timeout.ms=18000
replica.selector.class=org.apache.kafka.common.replica.RackAwareReplicaSelector

Helpful Commands

# *** CHANGE ME - Bootstrap servers ***
export BOOTSTRAP_SERVERS="b-2...us-east-1.amazonaws.com:9098,b-3...us-east-1.amazonaws.com:9098,b-4...us-east-1.amazonaws.com:9098"

# Declare an array of topic names to test
declare -a TOPICS=("test_3_3" "test_50_1" "test_100_1" "test_150_1" "test_300_1")

# Number of records to produce/consume
export MESSAGE_COUNT=10000000

# Record size (Bytes)
export REC_SIZE=400
# create topics
bin/kafka-topics.sh \
  --bootstrap-server $BOOTSTRAP_SERVERS \
  --command-config config/client-iam.properties \
  --create \
  --topic test_3_3 \
  --partitions 3 \
  --replication-factor 3

bin/kafka-topics.sh \
  --bootstrap-server $BOOTSTRAP_SERVERS \
  --command-config config/client-iam.properties \
  --create \
  --topic test_50_1 \
  --partitions 50 \
  --replication-factor 1

bin/kafka-topics.sh \
  --bootstrap-server $BOOTSTRAP_SERVERS \
  --command-config config/client-iam.properties \
  --create \
  --topic test_100_1 \
  --partitions 100 \
  --replication-factor 1

bin/kafka-topics.sh \
  --bootstrap-server $BOOTSTRAP_SERVERS \
  --command-config config/client-iam.properties \
  --create \
  --topic test_150_1 \
  --partitions 150 \
  --replication-factor 1

bin/kafka-topics.sh \
  --bootstrap-server $BOOTSTRAP_SERVERS \
  --command-config config/client-iam.properties \
  --create \
  --topic test_300_1 \
  --partitions 300 \
  --replication-factor 1
# list topics
bin/kafka-topics.sh --list \
  --bootstrap-server $BOOTSTRAP_SERVERS \
  --command-config config/client-iam.properties
# get producer perf help
bin/kafka-producer-perf-test.sh --help

# producer perf test
for topic in ${TOPICS[@]}; do
    echo ""
    echo $topic
    bin/kafka-producer-perf-test.sh \
      --topic $topic \
      --num-records $MESSAGE_COUNT \
      --record-size $REC_SIZE \
      --throughput -1 \
      --producer.config config/producer_perf_v1.properties \
      --print-metrics
    sleep 1m
done;
# get consumer perf help
bin/kafka-consumer-perf-test.sh --help

# consumer perf test
for topic in ${TOPICS[@]}; do
    echo ""
    echo $topic
    bin/kafka-consumer-perf-test.sh \
      --topic $topic \
      --messages $MESSAGE_COUNT \
      --consumer.config config/consumer_perf_v1.properties \
      --bootstrap-server $BOOTSTRAP_SERVERS | \
    jq -R .|jq -sr 'map(./",")|transpose|map(join(": "))[]'
    sleep 1m
done;
# delete topics
for topic in ${TOPICS[@]}; do
    echo ""
    echo $topic
    bin/kafka-topics.sh --delete \
      --topic $topic \
      --bootstrap-server $BOOTSTRAP_SERVERS \
      --command-config config/client-iam.properties
done;

References


The contents of this repository represent my viewpoints and not of my past or current employers, including Amazon Web Services (AWS). All third-party libraries, modules, plugins, and SDKs are the property of their respective owners. The author(s) assumes no responsibility or liability for any errors or omissions in the content of this site. The information contained in this site is provided on an "as is" basis with no guarantees of completeness, accuracy, usefulness or timeliness.

msk-perf-test's People

Contributors

garystafford avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.