-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Don't write to chunk cache if query results are outside of a desired window of time #14983
Comments
Maybe this is not a valid issue now that I have discovered Do the chunks that are pulled from the store still get written to the chunk cache if the chunks are outside of the |
Hi @mveitas, spoke with the Loki team today. @ashwanthgoli is going to investigate a little further but it still might be worth implementing this feature on initial glance. |
@salvacorts has also mentioned it might be worth handing queries older than 30 days to
I haven't tested this myself yet but I have tracked down the cache config for you: # Chunks will be handed off to the L2 cache after this duration. 0 to disable L2
# cache.
# CLI flag: -store.chunks-cache-l2.handoff
[l2_chunk_cache_handoff: <duration> | default = 0s] |
Thanks @Jayclifford345! l2 cache would be one way to reduce the churn for the desired duration. Any chunks older than
afaik there is no support to do this, happy to help if you would like to contribute. there is a hacky way to achieve what you want, i haven't tested it but it might work.
edit: in addition setting |
@ashwanthgoli This is something we are going to take on as we have a very large retention window that we need to have in place. While your workaround with the L2 cache would probably work, it's cleaner to have a separate configuration. |
As an alternative would it make sense to create a no-op cache implementation and configure the L2 cache to use that? |
prefer adding a new config to not store chunks older than the configured period |
Is your feature request related to a problem? Please describe.
NOTE - This issue assumes that queriers write back to the chunk cache. For some reason I had read somewhere that this happens, but I could be 100% wrong making this issue invalid.
We recently had a requirement to provide the capability to maintain active search of our logs for 365 days. As an organization we are looking to optimize searches within the past 30 days and keep as much data in cache as possible for this window in the cache to avoid having to go to object storage to retrieve data.
From my understanding, when a query is run, the chunks that are pulled back from object storage are written to the chunks cache. We are looking to avoid the cache churn for infrequent queries that are beyond the desired duration (in this case 30 days). With this configuration we would reduce the amount of data being written tot he chunks cache and reduce the evictions for older data that might not ever be viewed again.
Describe the solution you'd like
A configuration option is provided that would allow a duration to be specified that would allow the querier to write back to the chunk cache. If the chunk falls outside of this duration, it would not write the result back to the chunk cache.
Describe alternatives you've considered
The alternative is to build a bigger caching infrastructure to handle a longer duration and absorb the older and infrequent data written to the cache
The text was updated successfully, but these errors were encountered: