Skip to content
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

Migrate golang/snappy to klauspost/compress/snappy #13330

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chhetripradeep
Copy link

  • Since klauspost/compress/snappy is a drop-in replacement, well-maintained and claims to have better performance, it will be good to use it over golang/snappy.
  • I currently don't have a production grade prometheus setup where I can try it but I hope prombench can give us those numbers.

Signed-off-by: Pradeep Chhetri <pradeepchhetri4444@gmail.com>
@jesusvazquez
Copy link
Member

/prombench main

@prombot
Copy link
Contributor

prombot commented Dec 28, 2023

⏱️ Welcome to Prometheus Benchmarking Tool. ⏱️

Compared versions: PR-13330 and main

After successful deployment, the benchmarking results can be viewed at:

Other Commands:
To stop benchmark: /prombench cancel
To restart benchmark: /prombench restart main

@bboreham
Copy link
Member

Something went wrong - the Prometheus in prombench for this PR has only 12,000 series (should be millions).

@bboreham
Copy link
Member

/prombench cancel

@prombot
Copy link
Contributor

prombot commented Dec 31, 2023

Benchmark cancel is in progress.

@jesusvazquez
Copy link
Member

/prombench main

@prombot
Copy link
Contributor

prombot commented Jan 2, 2024

⏱️ Welcome to Prometheus Benchmarking Tool. ⏱️

Compared versions: PR-13330 and main

After successful deployment, the benchmarking results can be viewed at:

Other Commands:
To stop benchmark: /prombench cancel
To restart benchmark: /prombench restart main

@jesusvazquez
Copy link
Member

Running the benchmark again to see if it was a strange race condition. I'll watch closely to cancel earlier.

@@ -550,7 +550,8 @@ func TestCheckpointSeriesReset(t *testing.T) {
segments int
}{
{compress: CompressionNone, segments: 14},
{compress: CompressionSnappy, segments: 13},
{compress: CompressionSnappy, segments: 14},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you comment on why this changed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After changing from golang/snappy to klauspost/compress/snappy, this test started failing, so to fix that i had to change it to 14. Should snappy compression have lesser number of segments than one without compression.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does seem concerning if the data size goes up.
Can you investigate whether this is a general pattern? Maybe the library author has advice?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure i will do some investigation about it.

@npazosmendez
Copy link
Contributor

Unfortunately, I don't think prombench exercises remote write, or does it? There is this script #13102 we developed to benchmark remote write as part of #13105 , that may help.

Also, we actually tried klauspost/compress/snappy as part of that too, but AFAIR results were not really better. I am happy to be proven wrong though.

@jesusvazquez
Copy link
Member

/prombench cancel

@prombot
Copy link
Contributor

prombot commented Jan 2, 2024

Benchmark cancel is in progress.

@jesusvazquez
Copy link
Member

This time the prombench got the timeseries right for both instances of prometheus but as @npazosmendez pointed out the benchmark isnt really going to give us evidence that the new lib performs better.

@chhetripradeep please have a look and see if you could come up with a meaningful benchmark for this PR. I'm also curious about this comment #13330 (comment)

@bboreham
Copy link
Member

bboreham commented Jan 2, 2024

Unfortunately, I don't think prombench exercises remote write

This is true, however I believe the WAL is Snappy-compressed by default, so we should be able to see the difference on writing.

@cstyan
Copy link
Member

cstyan commented Jan 5, 2024

Yep prombench doesn't test RW, but as nico pointed out we do have a benchmarking script for remote write.

However, I'd prefer to leave any changes out of remote write for now. Again as Nico mentioned we've tested a number of options, including klaus's snappy/s2 packages. The main benefit for remote write to change from golang/snappy is going to be on the receivers side. We're doing some refactoring of how the compression package(s) is used as part of the 2.0 work and so I'd prefer to just continue with those and merge it in separately or as part of 2.0.

@bboreham
Copy link
Member

Hello from the bug-scrub! This PR is waiting on a response to the point that compression seems to be worse.
@chhetripradeep do you think you will get back to it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants