-
Notifications
You must be signed in to change notification settings - Fork 636
Description
Today, Cruise Control are setting/resetting replication rate throttles on a per-task base. E.g. it set throttling before a task executes:
cruise-control/cruise-control/src/main/java/com/linkedin/kafka/cruisecontrol/executor/Executor.java
Line 1415 in 155bf3c
| throttleHelper.setThrottles(tasksToExecute.stream().map(ExecutionTask::proposal).collect(Collectors.toList())); |
Then clear the throttling for the broker after task finished and if there is no ongoing-task on the same broker:
cruise-control/cruise-control/src/main/java/com/linkedin/kafka/cruisecontrol/executor/Executor.java
Line 1437 in 155bf3c
| throttleHelper.clearThrottles(completedTasks, inProgressTasks); |
Note that each set/clear throttle will be an individual Kafka admin request, will may take a couple of seconds.
The problem is: there can be a lot of tasks in the backlog that is involving the same broker. It doesn't make senses to set/clear the throttling for the same broker again and again on every task execution batch. From local unit test running, it takes ~20 seconds for adminClient to handle each set/clear throttle request.
If we set the throttling for broker at the beginning of the execution, and only clean up the throttling after all tasks finished execution, that should speed up the rebalance.
Note: this is not the concurrency throttling, but the replication bytes throttling. This throttle is set by Cruise Control sending request to kafka brokers to cap the max replication bytes rate.