-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Slow Producer #603
Comments
It's not clear if the producer and consumer are sharing the same client. If they are then that is likely the problem: from a single client, the kafka broker serves requests strictly serially, so while the consumer has requested new messages, the producer cannot proceed. Try using separate clients. |
Hi, yes that was the problem, thanks for your help. Maybe the documentation should be updated, currently https://github.com/Shopify/sarama/blob/master/client.go#L12 states "A single client can be safely shared by multiple concurrent Producers and Consumers." |
As pointed out in #603 this is generally inefficient and misleading.
Hi,
we observe another peculiar behaviour, if we have a consumer and sync producer for the same topic running in two different goroutines (regardless of the number of partitions), the producer has significantly slower (~10x) produce rate than if it's running by itself.
We're using Sarama version Version 1.8.0 (2016-02-01), Kafka 0.8.2.1 and go1.5.1 linux/amd64
Config is
This is the profiler graph
https://www.dropbox.com/s/n5s0xssygcojxej/pprof001.svg?dl=0
code is here
https://gist.github.com/kiro/3fb5a80a2196d694cc61
logs look like
The text was updated successfully, but these errors were encountered: