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

Optimize async_search polling with dynamic wait_for_completion #143277

Closed
Dosant opened this issue Oct 13, 2022 · 4 comments
Closed

Optimize async_search polling with dynamic wait_for_completion #143277

Dosant opened this issue Oct 13, 2022 · 4 comments
Labels
enhancement New value added to drive a business result Feature:Search Sessions Feature:Search Querying infrastructure in Kibana Icebox impact:low Addressing this issue will have a low 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.

Comments

@Dosant
Copy link
Contributor

Dosant commented Oct 13, 2022

Describe the feature:

Initially, when using a search strategy with the async search there was a search polling mechanism, where the client polls a search with a fixed 1s interval until the search completes.

We optimized it a bit to avoid excessive polling (every second) by doing the increase the polling interval as searches take longer to finish. The longer the search takes, the less noticeable the delay due to polling intervals.

We can improve it further by optimizing wait_for_completion param.

This needs testing and investigation

@Dosant Dosant added Feature:Search Querying infrastructure in Kibana performance enhancement New value added to drive a business result Team:AppServicesSv labels Oct 13, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServicesSv)

@exalate-issue-sync exalate-issue-sync bot added impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. loe:medium Medium Level of Effort impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. and removed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Oct 17, 2022
@Dosant
Copy link
Contributor Author

Dosant commented Oct 20, 2022

The logic that we probably should consider is the following:

When async search start - start it with looong wait_for_completion, e.g. 5 seconds, so that we receive the results as soon as possible if search completes quickly.

If search didn't complete in 5 seconds, then we can continue with increasing the polling interval and shortening the wait_for_completion (can probably keep the current logic) as this isn't that important anymore to give the results as soon as possible, as a couple seconds difference is not the noticeable from user perspective on this stage.

things to consider:

  • current poll interval should be adjusted to work nicely with new wait_for_completion
  • need to make sure that long wait_for_completion doesn't lead to more risk in race condition bugs when saving the session while search request with long wait_for_completion is still pending. Might be that this search won't be extended.
  • how a lot of searches with long wait_for_completion affect Kibana server under load as requests will get longer to complete.

@exalate-issue-sync exalate-issue-sync bot added impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. and removed impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. labels Oct 20, 2022
@petrklapka petrklapka added Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. and removed Team:AppServicesSv labels Nov 21, 2022
@elasticmachine
Copy link
Contributor

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

@lukasolson lukasolson added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. and removed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Jan 23, 2023
@kertal kertal added the Icebox label Oct 8, 2024
@kertal
Copy link
Member

kertal commented Oct 8, 2024

Closing this because it's not planned to be resolved in the foreseeable future. It will be tracked in our Icebox and will be re-opened if our priorities change. Feel free to re-open if you think it should be melted sooner.

@kertal kertal closed this as not planned Won't fix, can't repro, duplicate, stale Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Search Sessions Feature:Search Querying infrastructure in Kibana Icebox impact:low Addressing this issue will have a low 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.
Projects
None yet
Development

No branches or pull requests

5 participants