-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
in_kafka: boost throughput #9800
Open
coreidcc
wants to merge
4
commits into
fluent:master
Choose a base branch
from
coreidcc:coreidcc
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+38
−4
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coreidcc
requested review from
edsiper,
leonardo-albertovich,
fujimotos and
koleini
as code owners
January 6, 2025 09:24
cosmo0920
reviewed
Jan 9, 2025
*/ | ||
ctx->poll_timeount_ms = 1; | ||
if (ins->is_threaded) { | ||
ctx->poll_timeount_ms = 550; // ensure kafa triggers timeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use /* */ style of comment here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not resolved this comment.
Polling every 1ms and committing each message individually results in rather pure performance in high volume Kafka clusters. Commiting in batches (relay on auto-commit of kafka) drastically improves performance. Signed-off-by: CoreidCC <[email protected]>
having 1ms timeout might make sense if the input plugin is running in the main thread (not introducing delay for others). but if we run in our very own thread then we should not over- ride the fetch.wait.max.ms configuration value from the kafka-consumer. this in conjuntion with using autocommit again boosts the throuhput significantly. Signed-off-by: CoreidCC <[email protected]>
Signed-off-by: CoreidCC <[email protected]>
Signed-off-by: CoreidCC <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have a Kafka cluster that ingests about 40k messages (about 60MB) of data per seconds. Fluent-bit in its current state stands no change to keep up with this load. Even Logstash is faster and vector is just consuming all these messages with ease.
Causes:
a) commits each message individually
b) a poll-timeout of just one 1ms (this completely overrides fetch.wait.max.ms from kafka)
probably related to "Batch processing is required in in_kafka. #8030"
Testing: To activate the changes one need to
[INPUT]
Name kafka
threaded true -> sets timeout fetch.wait.max.ms + 50ms (align our and kafkas timeout, ensures kafka triggers timeout)
enable_auto_commit true -> disable explicit commit call
-> The change doesn't do any dynamic allocations at all and therefore cant introduce any mem-leaks
-> The change has no impact on packaging
Throughput increased by more then a magnitude.