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

metrics(storage): add metrics for block cache #1717

Closed
hzxa21 opened this issue Apr 8, 2022 · 9 comments
Closed

metrics(storage): add metrics for block cache #1717

hzxa21 opened this issue Apr 8, 2022 · 9 comments

Comments

@hzxa21
Copy link
Collaborator

hzxa21 commented Apr 8, 2022

No description provided.

@twocode
Copy link
Contributor

twocode commented Apr 11, 2022

Currently sstable_store has a reference to state store metrics and record staff like #block requests/#block fetched remotely and durations.

@Little-Wallace
Copy link
Contributor

But it seems that the block-cache can only record the number of blocks, rather the total memory keep in block cache...

@MrCroxx
Copy link
Contributor

MrCroxx commented Apr 11, 2022

But it seems that the block-cache can only record the number of blocks, rather the total memory keep in block cache...

It's counting on the size by a weigher after #1512

@Little-Wallace
Copy link
Contributor

But it seems that the block-cache can only record the number of blocks, rather the total memory keep in block cache...

It's counting on the size by a weigher after #1512

Ok, I made a mistake. But how could get the accurate current memory usage?

@Little-Wallace
Copy link
Contributor

And as #1773 (comment) mentioned, the block reference in iterator will not be calculate in capacity of Cache if the entry has been evict.

@MrCroxx
Copy link
Contributor

MrCroxx commented Apr 11, 2022

And as #1773 (comment) mentioned, the block reference in iterator will not be calculate in capacity of Cache if the entry has been evict.

Yep. That would be a problem.

@Little-Wallace
Copy link
Contributor

I have ported BlockCache from RocksDB to my own project https://github.com/rust-lib-project/calibur/blob/table-cache/src/util/cache.rs. And it will only reduce memory when iterator release the cache-entry,

Maybe I could copy it to risingwave.

@MrCroxx
Copy link
Contributor

MrCroxx commented Apr 13, 2022

Maybe I could copy it to risingwave.

It seems that the implementation doesn't include an async wait map. We need one to prevent multiple requests on the same block from leading to multiple s3 web requests. 🤔 @Little-Wallace

@Little-Wallace
Copy link
Contributor

Maybe I could copy it to risingwave.

It seems that the implementation doesn't include an async wait map. We need one to prevent multiple requests on the same block from leading to multiple s3 web requests. 🤔 @Little-Wallace

Good catch. I'm thinking solution for this problem

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

No branches or pull requests

5 participants