Bird
0
0

Given this Kafka producer configuration snippet:

medium📝 Predict Output Q4 of 15
Kafka - Performance Tuning
Given this Kafka producer configuration snippet:
props.put("batch.size", 32768);
props.put("linger.ms", 50);
props.put("compression.type", "gzip");

What is the expected effect on producer throughput?
ANo change in throughput because batch.size is too small
BLower throughput due to increased linger time
CHigher throughput due to larger batches and compression
DThroughput decreases because gzip compression is slow
Step-by-Step Solution
Solution:
  1. Step 1: Analyze batch.size and linger.ms

    A batch size of 32768 bytes and linger.ms of 50ms allow larger batches and slight delay to accumulate messages, improving throughput.
  2. Step 2: Consider compression.type effect

    Using gzip compression reduces data size sent, improving network efficiency and throughput despite some CPU cost.
  3. Final Answer:

    Higher throughput due to larger batches and compression -> Option C
  4. Quick Check:

    Batch size + linger + compression = higher throughput [OK]
Quick Trick: Larger batch + linger + compression = better throughput [OK]
Common Mistakes:
  • Assuming linger.ms always lowers throughput
  • Ignoring compression benefits
  • Thinking batch.size is too small at 32768

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes