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

Multi level cache: check context add latency histogram #5596

Merged
merged 1 commit into from Oct 24, 2023

Conversation

yeya24
Copy link
Collaborator

@yeya24 yeya24 commented Oct 10, 2023

What this PR does:

This pr checks context in multi level cache and also adds two new histogram metric to track the latency to fetch data and backfill respectively.

The main reason to add the context check is for #5486. We have a backfill mechanism from higher level caches to lower level caches. For example, items exist in L2 cache (for example memcached) will backfill to L1 cache (inmemory cache).

However, when backfilling, cache.StoreXXX method doesn't take context as parameter. When backfilling thousands of keys, it might take quite a long time. In my test environment, I can see backfilling to inmemory cache took more than 2 minute to finish due to high lock contention.

The two histogram metrics are useful to measure the fetch and backfilling performance of multi level index cache.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@yeya24 yeya24 requested review from alanprot, friedrichg and alvinlin123 and removed request for alvinlin123 and alanprot October 10, 2023 15:38
Signed-off-by: Ben Ye <benye@amazon.com>

add backfill histogram

Signed-off-by: Ben Ye <benye@amazon.com>

update changelog

Signed-off-by: Ben Ye <benye@amazon.com>

lint

Signed-off-by: Ben Ye <benye@amazon.com>
@alanprot
Copy link
Member

LGTM

@yeya24 yeya24 merged commit 1d2e2ee into cortexproject:master Oct 24, 2023
14 checks passed
@yeya24 yeya24 deleted the check-ctx-multilevel-cache branch October 24, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants