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

feat(mincore): Add page fault limiter #18982

Merged
merged 1 commit into from
Jul 17, 2020
Merged

feat(mincore): Add page fault limiter #18982

merged 1 commit into from
Jul 17, 2020

Conversation

benbjohnson
Copy link
Contributor

This commit adds mincore.Limiter which throttles page faults causedby mmap() data. It works by periodically calling mincore() to determine which pages are not resident in memory and using rate.Limiter to throttle accessing using a token bucket algorithm.

Copy link
Contributor

@sebito91 sebito91 left a comment

Choose a reason for hiding this comment

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

This looks awesome, need to read more on the mincore functionality but I think this does the trick. You should think about submitting a patch to golang to include this in the os package outright (the calls to mincore)

cmd/influxd/launcher/launcher.go Show resolved Hide resolved
This commit adds `mincore.Limiter` which throttles page faults caused
by mmap() data. It works by periodically calling `mincore()` to determine
which pages are not resident in memory and using `rate.Limiter` to
throttle accessing using a token bucket algorithm.
@benbjohnson
Copy link
Contributor Author

Thanks. The mincore stuff is pretty specific. I'm not sure it's especially useful to be generally in os.

The funny thing about this PR is that I tried googling for how to call mincore() in Go and I had a small repo I had written 5 years ago (that I forgot about) that came up as the #2 result. 🤦‍♂️

Screen Shot 2020-07-17 at 9 38 24 AM

Copy link
Contributor

@jacobmarble jacobmarble left a comment

Choose a reason for hiding this comment

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

I don't have any feedback for this PR. For this or follow-on work:

  • add the limiter to TSI and series file
  • add metrics so that we can measure page faults

Thanks Ben, this is good work.

@benbjohnson benbjohnson merged commit c476da2 into master Jul 17, 2020
@benbjohnson
Copy link
Contributor Author

Merging this now. I'll add the other items as follow-on PRs.

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.

3 participants