-
Notifications
You must be signed in to change notification settings - Fork 5.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
feat(serializer.prometheusremote): improve performance #12971
feat(serializer.prometheusremote): improve performance #12971
Conversation
5fe88ef
to
902c410
Compare
Hi @mhoffm-aiven, Thanks for the PR. Is there an issue that goes along with this? If not could you file one please? Also looks like there are a few lint issues:
Thanks! |
902c410
to
4632e6a
Compare
Hey @powersj, No issue yet ( ill create one in a minute ); i was investigating performance issues with our telegraf promremote output and did some profiling. |
ok thanks - if you could include some of that data I would appreciate it! thanks again! |
I locally run that benchmark from this PR against main:
and against this PR:
main offenders were copied slices ( i fixed this by allocating once and truncating on loop iterations ) and sort.Slice instead of sort.Sort inplace. surprisingly |
top allocs with the benchmark on master (notice
top 10 on this PR:
cpu profile on master:
and on this PR:
so my theory was that getting rid of some of the allocations and using sort.Sort without reflection would improve performance |
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.
Thanks for the PR. Have you been running this successfully? Couple questions in line.
4632e6a
to
1b4659b
Compare
No this has not been running in our production yet. |
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.
Thanks!
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.
That's an awesome improvement @mhoffm-aiven! Thank you for this! I do have one comment though as now the batch-serialization will break if called concurrently. Please also find a suggestion inline...
plugins/serializers/prometheusremotewrite/prometheusremotewrite.go
Outdated
Show resolved
Hide resolved
plugins/serializers/prometheusremotewrite/prometheusremotewrite.go
Outdated
Show resolved
Hide resolved
5cd25df
to
a339b41
Compare
a339b41
to
b696d68
Compare
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
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.
Looks good to me. Thanks for your effort @mhoffm-aiven!
@powersj can you please take a look again after the changes!? |
Required for all PRs
resolves #12974