How Cruise Control works

Cruise Control is a Kafka load balancing component that can be used in large Kafka installations. Cruise Control can automatically balance the partitions based on specific conditions, and when adding or removing Kafka brokers.

The architecture of Cruise Control consists of the Load Monitor, Analyzer, Anomaly Detector and Executor as shown in the following illustration.

Load Monitor

Generates a cluster workload model based on standard Kafka metrics and resource metrics to utilize disk, CPU, bytes-in rate and bytes-out rate. Feeds the cluster model into Anomaly Detector and Analyzer.

Analyzer

Generates optimization proposals based on optimization goals provided by the user, and cluster workload model from Load Monitor. Hard goals and soft goals can be set. Hard goals must be fulfilled, while soft goals can be left unfulfilled if hard goals are reached. The optimization fails if the hard goal is violated by optimization results.

Anomaly Detector

Responsible for detecting the following anomalies:
Anomaly Cause Result
Broker failure Non-empty broker crashes or leaves a cluster. Cruise Control fixes the cluster by removing the failed brokers.
Goal violations Optimization is violated. Cruise Control automatically analyzes the workload and executes the optimization proposals, if self-healing is enabled.
Disk failure Non-empty disk dies. Cruise Control moves all the offline replicas to healthy brokers, if self-healing is enabled.
Metric anomaly Anomalies in the collected metrics. May first demote, and if the anomaly persists, remove slow brokers depending on the self.healing.slow.brokers.removal.enabled configuration.

Executor

Carries out the optimization proposals and it can be safely interrupted when executing proposals. The executions are always resource-aware processes.