liveBook · Manning

Bandwidth quota

As explained in Apache Kafka in Action

A bandwidth quota is a Kafka quota that limits the rate at which a client can produce or consume data.

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

How Apache Kafka in Action covers it

How deep it goes
Defines producer, consumer, and request limits, shows configuration commands, and explains throttling risks without detailing broker internals.
Examples
Uses default client settings, named-client overrides, byte-rate limits, request percentages, and throttle-time metrics.
What it assumes
Requires robust cluster and application monitoring before enforcing limits.
What you can do after
Operate/configure Kafka quotas with kafka-configs.sh and diagnose throttling through broker metrics.
How it connects
Connects producers, consumers, Kafka brokers, throttling, monitoring, and request CPU quotas.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Apache Kafka in Action. The section links point to the parts of the book it draws on.