A bandwidth quota limits how quickly a Kafka client can produce or consume data. Its primary job is protecting the cluster from misconfigured or faulty clients that could block shared resources. section 13.3
Apply quotas conservatively and watch their operational effects:
- Start with generous default quotas that accommodate normal peaks, then assign higher or lower limits for specific teams when justified. section 13.3
- Monitor Produce, Fetch, and Request throttle-time metrics; nonzero values identify clients currently being throttled. section 13.3
- Avoid aggressive limits: a producer can block in send() after filling its internal buffer, causing timeouts and cascading problems. section 13.3
kafka-configs.sh --bootstrap-server localhost:9092 \
--alter \
--entity-type clients \
--entity-default \
--add-config 'producer_byte_rate=1048576,\
consumer_byte_rate=2097152,request_percentage=100'
Set default producer, consumer, and request quotas with kafka-configs.sh. section 13.3
kafka-configs.sh --bootstrap-server localhost:9092 \
--alter \
--entity-type clients \
--entity-name newsletter \
--add-config 'producer_byte_rate=524288,request_percentage=50'
Override the defaults for a named client when its reasonable maximum load differs. section 13.3
