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

db: add custom profile for open iterators #1597

Closed
jbowens opened this issue Mar 23, 2022 · 5 comments
Closed

db: add custom profile for open iterators #1597

jbowens opened this issue Mar 23, 2022 · 5 comments

Comments

@jbowens
Copy link
Collaborator

jbowens commented Mar 23, 2022

Open iterators pin memtables and sstables. Iterators must not be kept open for a long duration to avoid bloating memory or disk space usage. Go supports custom pprof profiles, which we could leverage here. We would pprof.Profile.Add when an iterator is opened, and pprof.Profile.Remove when an iterator is closed, using the iterator pointer itself as the value argument.

Tangentially related to #723, another custom profile issue.

@nicktrav
Copy link
Contributor

Building on top of this profiling mechanism, we could also keep track of when iters were created (and where), and provide a means of introspecting "long lived iters".

If we wire that up into Cockroach, I can imagine something like a debug page that prints out all the open iters sorted in descending order of age, along with where they were allocated, and possibly all the other iter stats (bytes scanned, skipped, etc.).

@nicktrav
Copy link
Contributor

Linking #1609, cockroachdb/cockroach#68303 and cockroachlabs/support#1403 (internal), as they all would have benefited from the additional observability proposed here.

@jbowens
Copy link
Collaborator Author

jbowens commented Mar 31, 2022

Linking cockroachdb/cockroach#71481.

@nicktrav
Copy link
Contributor

Linking cockroachdb/cockroach#79879.

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

We have marked this issue as stale because it has been inactive for
18 months. If this issue is still relevant, removing the stale label
or adding a comment will keep it active. Otherwise, we'll close it
in 10 days to keep the issue queue tidy. Thank you for your
contribution to Pebble!

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

No branches or pull requests

2 participants