Producer Batching & Compression — Concept Check
Questions on Producer Batching & Compression. linger.ms and batch.size control how long the producer buffers records before sending; compression.type (snappy, lz4, zstd) reduces network and storage cost at the broker.
Questions in this quiz
8 questions on Producer Batching & Compression — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A Kafka producer is configured with `linger.ms=0` and `batch.size=16384`. What is the expected behavior?
- AHigh latency, low throughput
- BLow latency, high throughput
- CLow latency, low throughput
- DHigh latency, high throughput
2.A producer is experiencing high latency. The `linger.ms` is set to 20ms and `batch.size` is 512KB. What should be adjusted to reduce latency?
- AIncrease `batch.size`
- BIncrease `linger.ms`
- CDecrease `batch.size`
- DDecrease `linger.ms`
3.Which compression type offers the best compression ratio for Kafka producers?
- Alz4
- Bzstd
- Csnappy
- Dgzip
4.A Kafka producer is set with `compression.type=lz4`. What is the primary advantage of this setting?
- AHighest network savings
- BFastest compression speed
- CLowest CPU usage
- DBest compression ratio
5.A producer's `send()` call is blocking frequently. What could be the cause?
- A`buffer.memory` is full
- B`batch.size` is too high
- C`linger.ms` is too low
- D`compression.type` is inefficient
6.What happens if `linger.ms` is set to 0 in a high-throughput Kafka producer?
- ABatches are delayed, increasing throughput
- BBatches are sent immediately, reducing throughput
- CCompression is disabled
- DProducer buffer memory is ignored
7.A producer configured with `compression.type=gzip` is slow. Why might this be?
- Agzip is not supported by Kafka
- Bgzip increases network usage
- Cgzip provides low compression ratio
- Dgzip has high CPU overhead
8.Which of the following settings would likely increase both latency and throughput?
- A`linger.ms=0`, `batch.size=512KB`
- B`linger.ms=0`, `batch.size=16KB`
- C`linger.ms=5`, `batch.size=64KB`
- D`linger.ms=20`, `batch.size=512KB`