Kafka - Performance TuningYou want to optimize a Kafka producer for high throughput with minimal latency. Which combination of settings is best?Abatch.size=65536, linger.ms=5, compression.type=snappyBbatch.size=16384, linger.ms=100, compression.type=noneCbatch.size=32768, linger.ms=500, compression.type=gzipDbatch.size=8192, linger.ms=0, compression.type=snappyCheck Answer
Step-by-Step SolutionSolution:Step 1: Balance batch size and linger.ms for throughput and latencyA larger batch size with a small linger.ms (5ms) allows good batching without much delay, balancing throughput and latency.Step 2: Choose efficient compressionSnappy compression is fast and efficient, improving throughput without high CPU cost.Final Answer:batch.size=65536, linger.ms=5, compression.type=snappy -> Option AQuick Check:Large batch + low linger + fast compression = best throughput & latency [OK]Quick Trick: Use large batch, low linger, fast compression for best throughput [OK]Common Mistakes:MISTAKESUsing high linger.ms increases latencyChoosing no compression reduces throughputSmall batch sizes limit throughput
Master "Performance Tuning" in Kafka9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kafka Quizzes Advanced Stream Processing - Punctuators for time-based triggers - Quiz 12easy Advanced Stream Processing - Custom SerDes - Quiz 7medium Advanced Stream Processing - Custom SerDes - Quiz 11easy Advanced Stream Processing - Punctuators for time-based triggers - Quiz 1easy Event-Driven Architecture - Why event-driven scales applications - Quiz 8hard Kubernetes and Cloud Deployment - Kafka on Kubernetes (Strimzi) - Quiz 13medium Multi-Datacenter and Replication - Geo-replication strategies - Quiz 11easy Performance Tuning - Memory and buffer configuration - Quiz 15hard Performance Tuning - Partition count strategy - Quiz 15hard Security - ACL-based authorization - Quiz 4medium