cortex icon indicating copy to clipboard operation
cortex copied to clipboard

query-frontend: Response caching should work for subqueries and part queries.

Open bwplotka opened this issue 5 years ago • 18 comments

AC:

  • Subqueries should be split & cached.

I think that should not be that hard to implement, but we would need to finally parse the query and understand what is nested.

cc @brancz, @pracucci @tomwilkie

bwplotka avatar Feb 24 '20 15:02 bwplotka

@owen-d This is your area of expertise. What's your take, especially considering the recently merged #1878 ?

pracucci avatar Feb 25 '20 10:02 pracucci

We are happy to help in free time, but ideas/suggestions are very welcome.

Or if any work happened already for this (:

bwplotka avatar Feb 25 '20 10:02 bwplotka

Any update on this? :hugs:

Any pointers for contributors, e.g if we would want to tackle it?

bwplotka avatar Apr 14 '20 17:04 bwplotka

I'm not sure if this will be straightforward to implement. We currently sequence a set of middlewares in the query frontend, of which a caching middleware is one. This makes it hard to pull out part of a query without dealing with the promql Engine, which is what we did in the sharding work (https://github.com/cortexproject/cortex/pull/1878). This could be another reason to support a refactoring of the query frontend though. There are a number of issues derived from sequencing middlewares this way, such as https://github.com/cortexproject/cortex/issues/1882

Caching middleware: https://github.com/cortexproject/cortex/blob/master/pkg/querier/queryrange/results_cache.go

Another thought - this is something we may want to solve via some sort of query planner.

owen-d avatar Apr 14 '20 19:04 owen-d

Yes, definitely worth to look closer in to different design then. I would say initial promql parse might be necessary...

On Tue, 14 Apr 2020, 20:19 Owen Diehl, [email protected] wrote:

I'm not sure if this will be straightforward to implement. We currently sequence a set of middlewares in the query frontend, of which a caching middleware is one. This makes it hard to pull out part of a query without dealing with the promql Engine, which is what we did in the sharding work ( #1878 https://github.com/cortexproject/cortex/pull/1878). This could be another reason to support a refactoring of the query frontend though. There are a number of issues derived from sequencing middlewares this way, such as #1882 https://github.com/cortexproject/cortex/issues/1882

Caching middleware: https://github.com/cortexproject/cortex/blob/master/pkg/querier/queryrange/results_cache.go

Another thought - this is something we may want to solve via some sort of query planner.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cortexproject/cortex/issues/2178#issuecomment-613633294, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVA3OZ54MLVMWDAOPDDLOLRMSZKPANCNFSM4K2KDDZA .

bwplotka avatar Apr 14 '20 21:04 bwplotka

Something to add as well : https://github.com/thanos-io/thanos/issues/2569

bwplotka avatar May 06 '20 16:05 bwplotka

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 05 '20 18:07 stale[bot]

Still valid

pracucci avatar Jul 06 '20 07:07 pracucci

Still valid

pracucci avatar Sep 28 '20 14:09 pracucci

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 30 '20 22:11 stale[bot]

Still valid

pracucci avatar Dec 01 '20 08:12 pracucci

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 02 '21 03:03 stale[bot]

still valid

jtlisi avatar Mar 02 '21 03:03 jtlisi

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 02 '21 14:06 stale[bot]

Definitely still valid.

Example: you can write an instant query like count(up)[60m:1m] which is basically the same thing as a range-query of count(up) over 60m with step 1m. Query-frontend will cache the latter but not the former.

bboreham avatar Jul 23 '21 10:07 bboreham

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 22 '21 15:10 stale[bot]

Still valid

On Fri, Oct 22, 2021, 08:24 stale[bot] @.***> wrote:

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cortexproject/cortex/issues/2178#issuecomment-949731438, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANH4O4HWTAGGF762SCJJNTUIF62NANCNFSM4K2KDDZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

midnightconman avatar Oct 22 '21 16:10 midnightconman

This issue has been automatically marked as stale because it has not had any activity in the past 60 days. It will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 22 '22 14:01 stale[bot]