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

[Feature Request] Add setting controlling whether to allow size > 0 requests in the request cache #16485

Closed
peteralfonsi opened this issue Oct 25, 2024 · 1 comment · Fixed by #16484 or #16570
Assignees
Labels
enhancement Enhancement or improvement to existing feature or request Search:Performance

Comments

@peteralfonsi
Copy link
Contributor

peteralfonsi commented Oct 25, 2024

Is your feature request related to a problem? Please describe

Currently size > 0 requests aren't cached by default. This is because they usually don't have aggregations, and weren't considered worth storing in the limited on-heap request cache. But, with the rollout of tiered caching, the request cache can be much larger, and it can be worthwhile to cache size > 0 requests in this case. We expect this should increase request cache utilization, and therefore also help with latency.

Currently, the user can already explicitly allow size > 0 queries to be cached, by passing the URL parameter request_cache=true in the request. But, users may not be aware of this, and it might not be feasible for them to manually make this change.

Describe the solution you'd like

We should expose a dynamic cluster setting controlling whether size > 0 requests are cacheable. The default would be false, reflecting the current behavior. Such requests would still have to meet the other criteria for cacheability (no DFS queries, no now queries, etc.)

Related component

Search:Performance

Describe alternatives you've considered

In the future we may also want a more flexible/generic caching policy system for the request cache, where checking for cacheability is delegated to the cache implementations themselves. This would allow us to choose based on time took, size, or anything else that might be relevant to individual cache implementations.

However this would be significantly more complex and we think the most gain can come from allowing size > 0 requests to be cached.

Additional context

No response

@dbwiddis
Copy link
Member

Thanks for explaining the need for this! I like that the default doesn't change anything but it enables opt-in caching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request Search:Performance
Projects
Archived in project
2 participants