Bird
0
0

You want to reduce network usage but keep latency low in Kafka producer. Which tuning approach is best?

hard📝 Application Q9 of 15
Kafka - Performance Tuning
You want to reduce network usage but keep latency low in Kafka producer. Which tuning approach is best?
ASet batch.size to 64 KB, compression.type to 'none', and linger.ms to 100 ms.
BSet batch.size to 16 KB, compression.type to 'zstd', and linger.ms to 5 ms.
CSet batch.size to 1 KB, compression.type to 'gzip', and linger.ms to 0 ms.
DSet batch.size to 0, compression.type to 'snappy', and linger.ms to 0 ms.
Step-by-Step Solution
Solution:
  1. Step 1: Balance batch size and linger.ms

    16 KB batch size with 5 ms linger.ms allows small batches with slight delay to improve compression and reduce network calls.
  2. Step 2: Choose compression codec

    zstd provides good compression ratio with reasonable speed, reducing network usage effectively.
  3. Final Answer:

    Set batch.size to 16 KB, compression.type to 'zstd', and linger.ms to 5 ms. -> Option B
  4. Quick Check:

    Moderate batch + fast compression + small linger = low network, low latency [OK]
Quick Trick: Small linger + moderate batch + good compression saves bandwidth [OK]
Common Mistakes:
  • Using large linger.ms causing high latency
  • Disabling compression to save latency
  • Setting batch.size too small to compress effectively

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes