Apache Kafka

Producer Buffer Exhaustion Causing Request Blocking

warning
Resource ContentionUpdated Mar 2, 2026

When producer buffer memory is exhausted, send calls block waiting for space, causing application threads to stall and reducing overall throughput.

Technologies:
How to detect:

Monitor kafka.producer.buffer_pool_wait_time increasing or kafka.producer.available_buffer_bytes approaching zero while kafka.producer.buffer_total_bytes is constant. Check kafka.producer.waiting_threads > 0 to confirm threads are blocked.

Recommended action:

1. Increase buffer.memory: Allocate more buffer memory in producer configuration. 2. Reduce batch.linger.ms: Send smaller batches more frequently to free buffer space faster. 3. Increase max.in.flight.requests.per.connection: Allow more concurrent requests. 4. Check broker throughput: If brokers are slow, producers will buffer more. 5. Optimize compression: Enable compression.type to reduce buffer usage. 6. Monitor kafka.producer.record_send_rate: Ensure send rate matches broker capacity.