-
Notifications
You must be signed in to change notification settings - Fork 901
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
SerializingProducer is much slower than Producer in Python #1440
Comments
are you flushing after every produce? (this will be slow) |
I tried both flushing after every produce and flushing after producing many messages. In both cases, messages were put on the topic at that aforementioned rate, 12 per second. |
you should be able to get 10s of thousands of messages per second without the protobuf serdes. i don't have a good feel for how performant the protobuf serdes are (and you don't say anything about the size of your messages), but 12 per second seems very low. It doesn't seem like we have a benchmark application for Python, we should write one (marking as enhancement). |
I get the feeling it is doing a schema-registry lookup for each message, which would explain the low thruput. |
Can you please confirm if it was fixed with the version upgrade? |
Description
I was working on code to produce messages to a Kafka topic. The messages are protobuf bytes and I used SerializingProducer to pass the schema information. I tried a separate method where I imitated what was done here
It was able to produce and flush messages at a rate of about 12 messages per second. For my use case, this is way too slow.
When I just used Producer and took out any schema information, the rate suddenly jumped to ~100s of messages per second.
How to reproduce
Checklist
Please provide the following information:
confluent_kafka.version()
andconfluent_kafka.libversion()
):From
requirements.txt
with the Python library:confluent-kafka==1.7.0
From console:
Apache Kafka broker version:
Confluent Cloud
Client configuration:
{...}
Producer config:
Run from docker container derived from Python 3.8.8 base
First line of Dockerfile:
FROM python:3.8.8
'debug': '..'
as necessary)Using SerializingProducer:
Using Producer:
The text was updated successfully, but these errors were encountered: