-
Notifications
You must be signed in to change notification settings - Fork 5
chore: Added confluent-kafka-javascript to benchmarks. #59
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Paolo Insogna <[email protected]>
what are the results? |
Producer:
Consumer:
|
Signed-off-by: Paolo Insogna <[email protected]>
Signed-off-by: Paolo Insogna <[email protected]>
Note, this PR cannot land until confluentinc/confluent-kafka-javascript#306 since |
@ShogunPanda can you add these parameters to confluent kafka producer
In my benchmarks, the results were vastly different after adding these |
@Dhruv-Garg79 Did you add those parameters just to confluent or to others as well? |
The issue is that not all packages support all the parameters internally, even if they display all the parameters in the options. e.g. kafkajs does not support For kafkajs, I did add zstd compression using @mongodb-js/zstd package import { compress, decompress } from '@mongodb-js/zstd';
import { CompressionCodecs, CompressionTypes, Kafka, Partitioners, logLevel } from 'kafkajs';
CompressionCodecs[CompressionTypes.ZSTD] = () => {
return {
compress: async encoder => compress(encoder.buffer, 1),
decompress: async buffer => decompress(buffer),
};
};
await producer.send({
topic: 'topic-name',
compression: CompressionTypes.ZSTD,
messages: [
{ key: 'key1', value: 'hello world' },
{ key: 'key2', value: 'hey hey!' }
],
}) |
I see. Makes sense. |
Unless we need it for some reason, I don't think we will work in creating a benchmark tailored to any individual use case. |
@ShogunPanda is it possible to add some documentation on how to run this benchmark locally? will help me to compare each with the best parameters possible (not all libraries have good default settings) |
Nothing special, simply run:
Note that there are scripts in |
@ShogunPanda I was able to run producer benchmark, but not consumer one on my local. I followed these steps: docker compose -f docker/compose-cluster.yaml up
node --experimental-strip-types benchmarks/consumer.ts
node --experimental-strip-types benchmarks/utils/prepare-consumer-data.ts // in another terminal The consumer benchmark got stuck for a long time. can you please help? |
Additionally, could you share some insights on how @platformic/kafka is so fast compared to others? |
@ShogunPanda @mcollina these are the results I am getting for producer.
kafkajs seems to be the most stable in terms of performance. And I only made these changes to benchmark
node version - v22.16.0 |
For consumer benchmarks with
with
|
@mcollina @ShogunPanda what are your thoughts? |
We are busy with other tasks. We will take a look as soon as possible, but it might take a few weeks. |
Fixes #55.