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

base,sstable: include {loaded,cached} block counts... #1729

Closed

Conversation

irfansharif
Copy link

...in iterator stats. Similar to the byte counts exported in #1538,
these numbers can come in handy when reasoning about block cache hit
rates for slow scans. Fix up some stat pretty printing units while here.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

...in iterator stats. Similar to the byte counts exported in cockroachdb#1538,
these numbers can come in handy when reasoning about block cache hit
rates for slow scans. Fix up some stat pretty printing units while here.
irfansharif added a commit to irfansharif/cockroach that referenced this pull request May 30, 2022
Adds plumbing for surfacing the # of blocks read in total + from the
pebble block cache, things we're now tracking down in pebble:
github.com/cockroachdb/pebble/pull/1729. These numbers can come in handy
when reasoning about block cache hit rates for slow scans.

Release note: None
Copy link
Collaborator

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 7 files reviewed, 1 unresolved discussion (waiting on @irfansharif and @jbowens)


internal/base/iterator.go line 243 at r1 (raw file):

	// the compressed bytes. Currently, only the second-level index and data
	// blocks containing points are included.
	Blocks, BlockBytes uint64

I think its fine to try this out for experiments (I tend to copy experimental Pebble code into vendor and build a binary). But unless we have some data that shows that using BlockBytesInCache/BlockBytes is flawed as a cache hit rate metric, and we need BlocksInCache/Blocks, I would hold off on adding these counts to the master branch.
It creates overlap and potential confusion on what to look at.

I realize we have existing rocksdb.block.cache.hits and rocksdb.block.cache.misses metrics in CockroachDB, that are in terms of count. I think for the experiments with the latency spike we shouldn't try to compare with those and instead compare BlockBytesInCache/BlockBytes during the spike with that when there is no latency spike, for the SQL queries.

@irfansharif irfansharif deleted the 220527.export-block-counts branch June 15, 2022 21:42
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.

None yet

3 participants