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

Limiter: avoid stop-the-world pause when reading heap size #10325

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

bboreham
Copy link
Contributor

@bboreham bboreham commented Dec 30, 2024

What this PR does

Use a Go metric instead of calling runtime.ReadMemStats. Empirically this is much faster.

                  │ before.txt  │             after.txt              │
                  │   sec/op    │   sec/op     vs base               │
CombinedScanner-4   25.58µ ± 2%   12.41µ ± 3%  -51.48% (p=0.002 n=6)

In a trace from a large ingester; the stop-the-world pause was more like 1-5ms; see example in image.
(and this is called every 1 second)

image

Checklist

  • NA Tests updated.
  • NA Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • NA about-versioning.md updated with experimental features.

Use a Go metric instead of calling `runtime.ReadMemStats`.
Empirically this is much faster.

Signed-off-by: Bryan Boreham <[email protected]>
@bboreham bboreham requested a review from a team as a code owner December 30, 2024 21:58
Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov left a comment

Choose a reason for hiding this comment

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

SGTM

@bboreham bboreham merged commit 4723282 into main Jan 2, 2025
29 checks passed
@bboreham bboreham deleted the faster-utilization branch January 2, 2025 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants