Skip to content

Conversation

@minhancao
Copy link
Collaborator

Add runtime stats for number of lookups to the AsyncDataCache.

@minhancao minhancao self-assigned this Nov 6, 2025
@netlify
Copy link

netlify bot commented Nov 6, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 0f3df76
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/690e6a72e07745000862b915

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 6, 2025
minhancao added a commit to minhancao/velox that referenced this pull request Nov 6, 2025
…or#15430)

Add runtime stats for number of lookups to the AsyncDataCache.
@minhancao minhancao force-pushed the issimo_memory_cache_num_lookups branch from 8ccd37d to 48add28 Compare November 6, 2025 21:47
minhancao added a commit to minhancao/velox that referenced this pull request Nov 6, 2025
…or#15430)

Add runtime stats for number of lookups to the AsyncDataCache.
@minhancao minhancao force-pushed the issimo_memory_cache_num_lookups branch from 48add28 to 4c7a587 Compare November 6, 2025 21:49
@Yuhta Yuhta requested review from xiaoxmeng and zacw7 November 6, 2025 23:32
minhancao added a commit to minhancao/velox that referenced this pull request Nov 7, 2025
…or#15430)

Add runtime stats for number of lookups to the AsyncDataCache.
@minhancao minhancao force-pushed the issimo_memory_cache_num_lookups branch from 4c7a587 to f74ac9f Compare November 7, 2025 19:15
…or#15430)

Add runtime stats for number of lookups to the AsyncDataCache.
@minhancao minhancao force-pushed the issimo_memory_cache_num_lookups branch from f74ac9f to 0f3df76 Compare November 7, 2025 21:53
@prestodb-ci
Copy link

@ethanyzhang imported this issue as lakehouse/velox #15430

@zacw7
Copy link
Contributor

zacw7 commented Nov 12, 2025

curious why is this needed?

@minhancao
Copy link
Collaborator Author

minhancao commented Nov 17, 2025

@zacw7 This is needed for the tracking and calculation of the hit ratio % of the AsyncDataCache.

Hit ratio = number of hits / number of lookups to the AsyncDataCache

@zacw7
Copy link
Contributor

zacw7 commented Nov 17, 2025

@zacw7 This is needed for the tracking and calculation of the hit ratio % of the AsyncDataCache.

Hit ratio = number of hits / number of lookups to the AsyncDataCache

memory cache hit rate can be calculated by: memory_cache_num_hits / (memory_cache_num_hits + memory_cache_num_new)
memory + ssd cache hit rate: (memory_cache_num_hits + ssd_cache_read_entries) / (memory_cache_num_hits + memory_cache_num_new)

@minhancao
Copy link
Collaborator Author

@zacw7 Thanks for the equations! I have tried those equations before and they indeed would work for calculating the hit rate.

However, I would also like to track the total number of lookups to the memory cache. (memory_cache_num_hits + memory_cache_num_new) would not accurately track this due to memory_cache_num_hits only being incremented after the first entry access.

https://github.com/facebookincubator/velox/blob/main/velox/docs/monitoring/metrics.rst?plain=1#L335
https://github.com/facebookincubator/velox/blob/main/velox/common/caching/AsyncDataCache.cpp#L192

@zacw7
Copy link
Contributor

zacw7 commented Nov 17, 2025

@zacw7 Thanks for the equations! I have tried those equations before and they indeed would work for calculating the hit rate.

However, I would also like to track the total number of lookups to the memory cache. (memory_cache_num_hits + memory_cache_num_new) would not accurately track this due to memory_cache_num_hits only being incremented after the first entry access.

https://github.com/facebookincubator/velox/blob/main/velox/docs/monitoring/metrics.rst?plain=1#L335 https://github.com/facebookincubator/velox/blob/main/velox/common/caching/AsyncDataCache.cpp#L192

makes sense. thanks for the clarification.

Copy link
Contributor

@zacw7 zacw7 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 for adding this.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants