Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • none — establishes a null-key baseline for topics where ordering and co-partitioning are not required, such as log aggregation pipelines.
  • range — models workloads where a bounded, predictable set of keys cycles repeatedly, such as Kafka Streams joins or MirrorMaker 2 replication, where the same key must consistently land on the same partition to preserve ordering guarantees.
  • random — models workloads with a bounded but unpredictably distributed key space. A small key range (e.g., 10) relative to the partition count simulates hot-partition scenarios; a , where keys arrive in non-deterministic order rather than cycling sequentially. A large range (e.g., 1,000,000) approximates unique-key workloads such as IoT device data without the overhead of UUID generation.

...

  • Null keys — existing behavior (default)
    Code Block
    bin/kafka-producer-perf-test.sh \
      --topic my-topic --num-records 1000000 --record-size 1024 \
      --throughput -1 --bootstrap-server localhost:9092
  • Round-robin across 100 distinct keys
    Code Block
    bin/kafka-producer-perf-test.sh \
      --topic my-topic --num-records 1000000 --record-size 1024 \
      --throughput -1 --bootstrap-server localhost:9092 \
      --key-distribution range --message-key-range 100 --random-seed 10
  • Random keys from a space of 10,000
    Code Block
    bin/kafka-producer-perf-test.sh \
      --topic my-topic --num-records 1000000 --record-size 1024 \
      --throughput -1 --bootstrap-server localhost:9092 \
      --key-distribution random --message-key-range 10000 --random-seed 10

Compatibility, Deprecation, and Migration Plan

...