sarama icon indicating copy to clipboard operation
sarama copied to clipboard

Why does the pprof analysis show that github.com/IBM/sarama.(*partitionProducer).dispatch has a large number of coroutines enabled and suspended

Open Aliuyanfeng opened this issue 5 months ago • 1 comments

Description

as shown below,I am in the process of producing messages and find that a large number of coroutines are started

image

Versions
Sarama Kafka Go
v1.43.2 V2_5_0_0 1.20
Configuration
func (p *KFKPool) newConnection() (sarama.SyncProducer, error) {
	config := sarama.NewConfig()
	config.Version = sarama.V2_5_0_0
	config.Producer.RequiredAcks = sarama.WaitForLocal
	config.Producer.Partitioner = sarama.NewRandomPartitioner
	config.Producer.Return.Successes = true
	config.Producer.Timeout = time.Second * 5
	config.Producer.Retry.Max = 0
	config.Net.WriteTimeout = time.Second * 3
	client, err := sarama.NewSyncProducer([]string{p.host}, config)
	if err != nil {
		return nil, err
	}
	return client, nil
}

Looking forward to receiving your reply, thank you!🤣

Aliuyanfeng avatar Sep 10 '24 07:09 Aliuyanfeng