liveBook · Manning

Network throttling

As explained in Apache Kafka in Action

Throttling is the deliberate delaying or muting of client requests to keep resource usage within an enforced limit.

Network throttling deliberately delays client requests to keep Kafka resource usage within enforced limits. It protects brokers from faulty or malicious producers and consumers while distributing capacity among clients. section 13.3

Kafka applies throttling through quotas that can be configured by client, user, or default scope:

  • Set producer and consumer byte rates or limit the percentage of broker CPU time allocated to a client. section 13.3
  • Prefer user-level quotas when authentication is available; client IDs can be changed arbitrarily by clients. section 13.3
  • Treat quotas as overload protection rather than strict guarantees because enforcement occurs separately on each broker. 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'

Configure conservative default producer and consumer rates, then override them for clients with different resource requirements. section 13.3

How Apache Kafka in Action covers it

How deep it goes
Explains quota types, scopes, configuration strategy, and per-broker limitations, but does not provide monitoring procedures.
Examples
Uses kafka-configs.sh commands for default, client-specific, and user-specific producer or consumer quotas.
What you can do after
Operate/configure Kafka quotas with kafka-configs.sh and distinguish overload protection from guaranteed capacity.
How it connects
Connects quotas with Kafka brokers, producers, consumers, authentication, client IDs, and user principals.

Also explained in

Compare how 2 books explain network throttling →

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.