Bird
0
0

A Kafka producer uses batch.size=65536 and linger.ms=200. You want to reduce latency but keep throughput high. Which change is best?

hard📝 Application Q9 of 15
Kafka - Producers
A Kafka producer uses batch.size=65536 and linger.ms=200. You want to reduce latency but keep throughput high. Which change is best?
AReduce batch.size to 16384 and keep linger.ms the same
BReduce linger.ms to 50 and keep batch.size the same
CIncrease linger.ms to 500 and keep batch.size the same
DIncrease batch.size to 131072 and reduce linger.ms to 10
Step-by-Step Solution
Solution:
  1. Step 1: Understand latency and throughput tradeoff

    Reducing linger.ms lowers latency by sending batches faster.
  2. Step 2: Keep batch.size high to maintain throughput

    Keeping batch.size large allows bigger batches, preserving throughput.
  3. Final Answer:

    Reduce linger.ms to 50 and keep batch.size the same -> Option B
  4. Quick Check:

    Lower linger.ms + high batch.size = lower latency + high throughput [OK]
Quick Trick: Lower linger.ms to reduce latency, keep batch.size for throughput [OK]
Common Mistakes:
  • Reducing batch.size unnecessarily
  • Increasing linger.ms increasing latency
  • Increasing batch.size without adjusting linger.ms

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes