Bird
0
0

Given this Kafka producer config snippet:

medium📝 Predict Output Q13 of 15
Kafka - Performance Tuning
Given this Kafka producer config snippet:
{"batch.size": 16384, "linger.ms": 5}

What is the effect of setting linger.ms to 5?
AKafka delays sending messages by 5 seconds.
BKafka waits up to 5 ms to batch more messages before sending.
CKafka sends messages immediately without waiting.
DKafka ignores batch size and sends single messages.
Step-by-Step Solution
Solution:
  1. Step 1: Understand linger.ms meaning

    linger.ms sets how long Kafka waits to batch messages before sending.
  2. Step 2: Interpret the value 5

    Setting it to 5 means Kafka waits up to 5 milliseconds to collect more messages for batching.
  3. Final Answer:

    Kafka waits up to 5 ms to batch more messages before sending. -> Option B
  4. Quick Check:

    linger.ms controls wait time = C [OK]
Quick Trick: linger.ms sets wait time in milliseconds before sending batch [OK]
Common Mistakes:
  • Thinking linger.ms is seconds, not milliseconds
  • Assuming immediate send ignores linger.ms
  • Confusing linger.ms with batch.size

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes