-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Index Patterns] Excessive index patterns fetching on a dashboard #82153
Comments
Pinging @elastic/kibana-app-arch (Team:AppArch) |
@elastic/kibana-platform, do you think it makes sense to improve on SO client level? |
Thanks for finding this @Dosant - very helpful. I think it would be worthwhile to alter the Index Pattern service cache to address this, independent of the decision to fix this at a saved object client level. |
Well, short answer would be no. It's really at the consumer discretion to have the appropriate logic to avoid requested the same object multiple times when performing a @rudolf, wdyt? |
|
Hi, One note here is that the dashboard with 50 panels is loading very fast in Kibana 6.8.3 and in the bulk_get the request JSON has the index pattern ids only once and not as many times as many panels are on the dashboard. The behavior in 6.8.3:
The behavior in 7.9.3:
Of course, with 5 panels the loading time is not so different but with 50 panels after the bulk_get the browser spends 20+ seconds to parse the response in 7.9.3. Regards, |
Sorry, I misunderstood the problem. I thought you were calling
is sending the duplicates to the backend in the In that case you are right. Even if it's an implementation detail, this should be optimized at the SO client's level. I would call that an enhancement/ perf optimization though, not a bug, as that doesn't lead to any error. Created #82581 |
I think so, yes, thank you! Could be closed unless @mattkime also wants to polish this on index pattern level. |
@Dosant I don't see a reason to make index pattern related changes considering @pgayvallet 's PR. |
@mattkime, just thought of the small bit we still could improve on index pattern side: With #82603 we optimized data over the network, but on index pattern layer we still waste time on scripting while initializing index patterns from saved object, because we check for cache hit only in the beginning of This redundant processing could accumulate into significant blocking time chunks for large index patterns when we load the dashboard with bunch of visualization: I think we should check a cache hit twice:
in 2 it is possible that some other task has already put a final index pattern object into cache and we no longer need to spend cpu ticks to initialize the same index pattern again. This micro optimization should safe significant amount of cpu time on initial loading of large dashboards with large index patterns. pseudo code: Now:
Improvement::
|
unsubscribing now that #82603 is closed. Feel free to re-ping if you need anything else from our side. |
@Dosant Thats a good point. I'm also thinking of the case where we are loading the field list on the fly. We'd be hitting the field caps api pretty hard if we're not caching at the appropriate level. I agree that this is worth doing. |
Kibana version: 7.9.3
Describe the bug:
On cold load of a dashboard with multiple visualisations each visualisation get its index patterns. It is often the case that index pattern is the same.
Multiple visualisation in parallel calling: https://github.com/elastic/kibana/blob/master/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts#L360 for the same index_pattern.
There is a cache mechanism, but it isn't used until an index pattern is loaded. So when getting the same index pattern from multiple places until it is loaded
savedObjectsClient.get
will be called multiple times with for the same object.Then
savedObjectsClient.get
has a batching mechanism, but it still retrieves multiple identical saved objects.Steps to reproduce:
bulk_get
requestExpected behavior:
No redundant index patterns objects flying over the network.
Screenshots (if relevant):
Any additional context:
The text was updated successfully, but these errors were encountered: