Bird
0
0

How can you combine batch.size and buffer.memory settings to avoid producer blocking under high load?

hard📝 Application Q9 of 15
Kafka - Performance Tuning
How can you combine batch.size and buffer.memory settings to avoid producer blocking under high load?
ASet buffer.memory equal to batch.size to minimize memory usage
BSet buffer.memory to zero to disable buffering
CSet batch.size larger than buffer.memory to force quick sends
DSet buffer.memory much larger than batch.size times number of concurrent batches
Step-by-Step Solution
Solution:
  1. Step 1: Understand buffer.memory and batch.size relation

    buffer.memory is total memory for all batches; batch.size is size per batch. To avoid blocking, buffer.memory must accommodate multiple batches.
  2. Step 2: Correct sizing to prevent blocking

    Setting buffer.memory much larger than batch.size times concurrent batches ensures enough memory to buffer messages without blocking.
  3. Final Answer:

    Set buffer.memory much larger than batch.size times number of concurrent batches -> Option D
  4. Quick Check:

    buffer.memory > batch.size * concurrency prevents blocking [OK]
Quick Trick: buffer.memory must cover multiple batches to avoid blocking [OK]
Common Mistakes:
MISTAKES
  • Setting buffer.memory too small causes blocking
  • Matching buffer.memory to batch.size causes memory shortage
  • Setting buffer.memory to zero disables buffering incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes