elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.67k stars 8.23k forks source link

Repeated requests are being made to load the config saved-object when using search source client #192170

Open mikecote opened 2 months ago

mikecote commented 2 months ago

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:

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

elasticmachine commented 2 months ago

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

lukasolson commented 2 months ago

Related to https://github.com/elastic/kibana/issues/84923.