Bird
0
0

You want to optimize a Kafka producer for maximum throughput but still ensure messages are not lost. Which combination of settings is best?

hard📝 Application Q15 of 15
Kafka - Performance Tuning
You want to optimize a Kafka producer for maximum throughput but still ensure messages are not lost. Which combination of settings is best?
Abatch.size=512, linger.ms=50, acks=0, compression.type=lz4
Bbatch.size=1024, linger.ms=0, acks=0, compression.type=none
Cbatch.size=16384, linger.ms=0, acks=1, compression.type=gzip
Dbatch.size=65536, linger.ms=20, acks=all, compression.type=snappy
Step-by-Step Solution
Solution:
  1. Step 1: Maximize throughput with batching and linger

    Large batch.size (65536) and linger.ms (20ms) allow grouping many messages before sending.
  2. Step 2: Ensure reliability and compression

    acks=all ensures all replicas confirm, preventing loss. Compression (snappy) reduces data size, improving throughput.
  3. Final Answer:

    batch.size=65536, linger.ms=20, acks=all, compression.type=snappy -> Option D
  4. Quick Check:

    Large batch + linger + acks=all + compression = batch.size=65536, linger.ms=20, acks=all, compression.type=snappy [OK]
Quick Trick: Big batch + linger + acks=all + compression = best throughput + safety [OK]
Common Mistakes:
MISTAKES
  • Choosing acks=0 losing reliability
  • Using too small batch sizes
  • Ignoring compression benefits

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes