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

[PoC] rounding ms by default #178721

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

ppisljar
Copy link
Member

@ppisljar ppisljar commented Mar 14, 2024

PoC: round now to 0ms in dateMath
Goal: increase ES cache hits

@ppisljar
Copy link
Member Author

i compared average request time when using the rounding compared to not using the rounding:
(lens, single layer, 3 metrics, terms agg, from now-1y to now

  • average request time without rounding 41s
  • average request time with rounding 41s

there is no visible difference between average request times when using the rounding or not.

However, we hypothesise that using the rounding might increase the number of time es cache is hit (which makes requesrts way faster, in my tests average response when hitting the cache (running the test second time) was 1.5s

@ppisljar
Copy link
Member Author

After more in depth look i think rounding will not (significantly) increase the number of hits in the cache, here is why:

To hit the cache multiple queries would need to be made with same time filter. When using multiple same queries on single dashboard this is already guaranteed thru nowProvider which gives same 'now' to all panels. So this could only play a role in multiuser scenarios.

However user2 would need to run the same query as user1 at mostly the same time (only ms difference allowed). In this case when cache is not yet hit by the first user the second user will anyway need to wait for the query to complete, so this will not get him any performance benefits in terms of time to response. It may however improve elasticsearch memory/cpu utilization ?

@ppisljar
Copy link
Member Author

ppisljar commented Mar 19, 2024

We could make the rounding period configurable. If rounding would be set to 1 minute then this would work:

  • user 1 sends a query at 01 seconds, lets say it takes 30 seconds to load, user 2 tries to send same query at 31 second and gets results from cache. On high load kibana instandces even when rounding to 1s we might still see improvement.

open question: is this seen as a user or sys admin setting ? (should it be in datepicker or in advanced settings ? )

@ppisljar ppisljar changed the title rounding ms by default [PoC] rounding ms by default May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant