Skip to Main Content

Example: Simple Benchmark

This article aims to guide you through completing a simple message sending and receiving load to verify the core features of AutoMQ.

After successfully installing AutoMQ via Cluster Deployment on Linux▸, you will obtain a list of Bootstrap Server addresses similar to the following format:

192.168.0.1:9092,192.168.0.2:9092

If you installed via Deploy Locally▸, the Bootstrap Server address will be:

broker1:9092,broker2:9092

In all steps, make sure to replace the Bootstrap Server address with the actual address you obtained.

Prerequisites

  • Linux/Mac/Windows Subsystem for Linux

  • Docker

If the container image download is slow, please refer to Docker Hub Mirror Configuration▸

Create Topic


CMD='docker run --network automq_net automqinc/automq:latest /bin/bash -c "/opt/kafka/kafka/bin/kafka-topics.sh --create --topic test-topic --bootstrap-server broker1:9092,broker2:9092"'; [ "$(uname)" = "Linux" ] && eval "sudo $CMD" || eval $CMD

Send Message


CMD='docker run --network automq_net automqinc/automq:latest /bin/bash -c "/opt/kafka/kafka/bin/kafka-producer-perf-test.sh --topic test-topic --num-records=1024000 --throughput 5120 --record-size 1024 --producer-props bootstrap.servers=broker1:9092,broker2:9092"'; [ "$(uname)" = "Linux" ] && eval "sudo $CMD" || eval $CMD

Consume Message


CMD='docker run --network automq_net automqinc/automq:1.0.4 /bin/bash -c "/opt/kafka/kafka/bin/kafka-consumer-perf-test.sh --topic test-topic --show-detailed-stats --timeout 300000 --messages=1024000 --reporting-interval 1000 --bootstrap-server=broker1:9092,broker2:9092"'; [ "$(uname)" = "Linux" ] && eval "sudo $CMD" || eval $CMD