Bird
0
0

A Kafka producer is configured with buffer.memory=1048576 and batch.size=16384. The producer throws a timeout error when sending. What is a likely cause?

medium📝 Debug Q6 of 15
Kafka - Performance Tuning
A Kafka producer is configured with buffer.memory=1048576 and batch.size=16384. The producer throws a timeout error when sending. What is a likely cause?
AThe batch.size is larger than buffer.memory
BThe buffer.memory is too small causing blocking and timeout
Clinger.ms is set to zero causing immediate sends
Dacks is set to zero causing no acknowledgments
Step-by-Step Solution
Solution:
  1. Step 1: Analyze buffer.memory and batch.size values

    buffer.memory is 1MB, batch.size is 16KB, which is valid. But small buffer.memory can fill quickly.
  2. Step 2: Understand timeout cause

    If buffer fills and producer blocks waiting for space, it can timeout if max.block.ms is exceeded.
  3. Final Answer:

    The buffer.memory is too small causing blocking and timeout -> Option B
  4. Quick Check:

    Small buffer.memory can cause send timeouts [OK]
Quick Trick: Small buffer.memory may cause blocking and timeouts [OK]
Common Mistakes:
MISTAKES
  • Assuming batch.size larger than buffer.memory
  • Confusing linger.ms with timeout cause
  • Mixing acks with buffer issues

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes