-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
KafkaConsumer runs 8x slower since v1.4.5 #1888
Comments
Hey, thanks for taking the time to investigate and run performance tests! We have some rudimentary benchmarking scripts in FWIW, the referenced commit is one of many aimed at fixing deadlock failures and other concurrency related issues and unfortunately there are no plans to revert. The deadlocking issues are serious and are my highest priority in the short term. But this is also very important and hopefully I can put some time into this as well. Thanks again! |
I believe this is fixed #1902 -- thanks for the detailed writeup! As of 1.4.7 (and current master), the KafkaConsumer iterator will no longer use a custom implementation and just wrap consumer.poll(). This will simplify the internals and also should end up increasing performance a bit from the 1.4.4 numbers you measured. If you have time and the inclination, I would love to see results from your tests against the upcoming 1.4.7 release as well. |
This is fantastic! I don't quite have the time for as rigorous of tests as I initially did, but I did some basic ones:
I'm not sure why I'm only seeing about a 4x decrease with the "breaking" commit, but the good news is that 1.4.7 seems to be the most performant of all of them! |
My org uses the prometheus-kafka-consumer-group-exporter project, which depends on this library. All this project does is read through the
__consumer_offsets
topic and generate metrics about the consumer groups. The latest version fails to read through the topic quickly enough to keep up.With some digging, I found that this performance change started at this commit: 8c07925. I verified this with an experiment where I ran the following script against this commit, the commit preceding it (7a99013), and master:
I ran three 2 minute trials against each commit to test the throughput of the consumer. Here are the results:
As you can see, this commit cause the consumer to run 8 times slower (2,426,802 messages vs. 300,187 messages). This has not improved since then.
I do not understand the details around this commit, but it has rendered this project unusuable on the latest version of kafka-python.
The text was updated successfully, but these errors were encountered: