On this page
Kafka Improvement Proposal
KIP-73: replication quotas, throttle a reassignment
KIP-73 lets you cap how fast Kafka copies data while it moves partitions between brokers. Without a cap, a big reassignment uses all the network and disk it can and slows down normal traffic. With a throttle, the move takes longer but producers and consumers keep their latency.
- Proposal
- KIP-73, Replication Quotas
- Status
- Shipped Since Kafka 0.10.1 (2016).
- Area
- Cluster and operations
- Proposal page
- KIP-73 on the Apache Kafka wiki
Why it was needed
Adding a broker, draining one or rebalancing load means copying whole partitions. A new replica fetches as fast as it can, and on a busy cluster that can saturate the network, push normal followers out of the ISR and raise produce latency for every client. Operators had no lever except moving fewer partitions at a time by hand.
What it changes
Two broker settings set the byte rate: leader.replication.throttled.rate for leaders sending data and follower.replication.throttled.rate for followers fetching it. Two topic settings say which replicas the throttle applies to, so only the moving replicas are slowed down and regular replication stays at full speed. A throttled replica joins the ISR once it has caught up, like any other.
How to use it
- Pass --throttle <bytes per second> to kafka-reassign-partitions.sh --execute; it sets the rates and the throttled replica lists for you.
- Run --verify after the move finishes; it removes the throttle, which otherwise stays in place.
Where it stands
Shipped in Kafka 0.10.1 and unchanged in principle since. KIP-455 (Kafka 2.4) added a proper reassignment API to the admin client, and the throttle works with it as well.
What comes next
Stable. Tools such as Cruise Control set the throttle automatically.
See it in the simulator
- Kafka replication throttle during partition reassignment (Throttled reassignment under load) Step 4: Past the un-throttled window - still catching up Open at this step: Kafka replication throttle during partition reassignment
- Kafka replication throttle during partition reassignment (Throttled reassignment under load) Step 6: broker-4 joins the ISR Open at this step: Kafka replication throttle during partition reassignment