Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Aliuyanfeng opened this issue Sep 10, 2024 · 1 comment

Comments

@Aliuyanfeng
Copy link

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!🤣

@puellanivis
Copy link
Contributor

This is expected. There’s quite a few different goroutines that get started per partition. If you have enough partitions, then this number can explode pretty fast. However, most of them are parked at any given time, so their impact on performance is minimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants