Bird
0
0

You want to optimize Kafka producer throughput for large messages but keep latency low. Which combination of settings is best?

hard📝 Application Q15 of 15
Kafka - Performance Tuning
You want to optimize Kafka producer throughput for large messages but keep latency low. Which combination of settings is best?
AUse default <code>batch.size</code> and <code>compression.type</code> = "none"
BDecrease <code>batch.size</code> and disable compression
CSet <code>batch.size</code> to 0 and use <code>compression.type</code> = "gzip"
DIncrease <code>batch.size</code> and use <code>compression.type</code> = "lz4"
Step-by-Step Solution
Solution:
  1. Step 1: Consider batch.size impact on throughput and latency

    Larger batch sizes improve throughput by sending more data at once but can increase latency slightly.
  2. Step 2: Choose compression type for speed and size

    LZ4 compression is fast and efficient, reducing message size without high CPU cost, helping throughput and latency.
  3. Step 3: Evaluate other options

    Decreasing batch size reduces throughput; disabling compression wastes bandwidth; batch.size=0 causes no batching.
  4. Final Answer:

    Increase batch.size and use compression.type = "lz4" -> Option D
  5. Quick Check:

    Large batch + fast compression = best throughput & low latency [OK]
Quick Trick: Big batch + fast compression (lz4) balances speed and size [OK]
Common Mistakes:
MISTAKES
  • Choosing gzip which is slower than lz4
  • Setting batch.size to 0 reducing throughput
  • Disabling compression reduces efficiency

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes