baisang
baisang

Reputation: 434

Kafka rolling restart active controller last performance benefits

Confluent and many others recommend during rolling restarts to ensure that the active controller of the Kafka cluster is restarted last:

The active controller should be the last broker you restart. This is to ensure that the active controller is not moved on each broker restart, which would slow down the restart.

(from https://docs.confluent.io/current/kafka/post-deployment.html#rolling-restart)

Does anyone have experience with what the time difference is between rolling restarts saving the active controller for last vs not paying attention to it? I'm trying to understand how significant the difference is, as in my basic testing with a small test cluster of size 3 I don't see that much difference (which is to be expected since the cluster is so small)

Upvotes: 5

Views: 1424

Answers (1)

Mickael Maison
Mickael Maison

Reputation: 26865

When the active controller is restarted, the cluster has to "elect" a new controller. When a broker is elected controller, it has to load the cluster state and be ready to handle controller duties. In practice, this usually only takes a few seconds so it's not noticable.

However you can imagine that if you keep restarting the controller, these few seconds can add and lead to a significant impact.

Restarting the controller last is a simple way to ensure that regardless the size of your cluster, a rolling restart will only trigger a single controller election.

Upvotes: 4

Related Questions