-
Notifications
You must be signed in to change notification settings - Fork 697
Open
Description
I’m using confluent-kafka-go to run a consumer on a remote server and a producer locally. Every time I start the consumer with a new group.id (I generate it using the PID), the first partition assignment takes 1–2 minutes. Subsequent restarts finish in under 5 seconds, and local-to-local runs are always fast (< 5 s).
My consumer config is:
groupID := fmt.Sprintf("kafka-go-client-%d", os.Getpid())
c, err := kafka.NewConsumer(&kafka.ConfigMap{
"bootstrap.servers": os.Getenv("KAFKA_BOOTSTRAP_SERVERS"),
"group.id": groupID,
"auto.offset.reset": "latest",
"enable.auto.commit": "true",
"auto.commit.interval.ms": "5000",
"security.protocol": "SASL_PLAINTEXT",
"sasl.mechanisms": "PLAIN",
"sasl.username": os.Getenv("KAFKA_CLIENT_USERNAME"),
"sasl.password": os.Getenv("KAFKA_CLIENT_PASSWORD"),
})Questions:
- Why does the first rebalance on the remote server take so long compared to later restarts?
- Which client or broker settings should I tune to speed up that initial assignment?
- Would using static membership (
group.instance.id) remove this long delay, and how do I configure it in confluent-kafka-go?
Metadata
Metadata
Assignees
Labels
No labels