Bird
0
0

Why does increasing linger.ms sometimes improve throughput but can also increase latency in Kafka producers?

hard📝 Conceptual Q10 of 15
Kafka - Performance Tuning
Why does increasing linger.ms sometimes improve throughput but can also increase latency in Kafka producers?
ABecause linger.ms increases batch size limit, improving throughput but causing errors
BBecause linger.ms compresses messages more, improving throughput but slowing CPU
CBecause linger.ms delays sending to batch more messages, improving throughput but adding wait time
DBecause linger.ms controls retries, improving throughput but risking duplicates
Step-by-Step Solution
Solution:
  1. Step 1: Understand linger.ms effect on batching

    linger.ms sets how long producer waits before sending batch, allowing more messages to accumulate and increasing batch size.
  2. Step 2: Tradeoff between throughput and latency

    Waiting longer improves throughput by sending bigger batches but adds delay, increasing latency for individual messages.
  3. Final Answer:

    Because linger.ms delays sending to batch more messages, improving throughput but adding wait time -> Option C
  4. Quick Check:

    linger.ms trades latency for throughput [OK]
Quick Trick: linger.ms trades latency for throughput [OK]
Common Mistakes:
MISTAKES
  • Thinking linger.ms controls compression
  • Confusing linger.ms with batch size limit
  • Assuming linger.ms controls retries

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes