Repeated requests are being made to load the config saved-object when using search source client #192170
Labels
Feature:Search
Querying infrastructure in Kibana
impact:medium
Addressing this issue will have a medium level of impact on the quality/strength of our product.
loe:medium
Medium Level of Effort
performance
Team:DataDiscovery
Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
After running some performance tests for Kibana Alerting, I noticed in the APM traces that whenever we create a search source client (
await dataPlugin.search.searchSource.asScoped
), it performs four sets of requests to the following endpoints:POST /_security/user/has_privileges
GET /.kibana_8.16.0/_doc/config%3A8.16.0
The alerting framework use to create a search source client and data view object before running each alerting rule, regardless if it was used or not. Whenever we run at a scale of 32,000 alerting rule runs per minute, it correlated to 128k requests to has_privileges and 128k requests to config each minute for the search source service and ~32k for data view service. We’ve now moved to lazy load these components but figured I’d share the findings for the search source client. It may still be a high num of requests for users running alerting rules that use search source / data views.
Preferably the optimizations work well when there are a large number of search source and data view instances created.
APM trace:
![Image](https://private-user-images.githubusercontent.com/3694571/364770573-07cedb19-a0b2-4591-86f8-246b6d0f89e2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NjU3MzEsIm5iZiI6MTczODk2NTQzMSwicGF0aCI6Ii8zNjk0NTcxLzM2NDc3MDU3My0wN2NlZGIxOS1hMGIyLTQ1OTEtODZmOC0yNDZiNmQwZjg5ZTIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMjE1NzExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2E5MzA3YWNiNjQwNzJkMWI0ZThhMTc0NmY3ZWI0NGFlODViY2M5NjA4OGViN2ZjMjlkODlhYWZkZWY5NjgxYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.3vYw60pkODtk-VyGyvR6Qxy7WhabW_x1Ivleiak0SV4)
The text was updated successfully, but these errors were encountered: