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

Allow setting max_concurrent_shard_requests for _msearch #22206

Closed
s1monw opened this issue Aug 21, 2018 · 15 comments
Closed

Allow setting max_concurrent_shard_requests for _msearch #22206

s1monw opened this issue Aug 21, 2018 · 15 comments
Labels
Feature:Search Querying infrastructure in Kibana Team:Visualizations Visualization editors, elastic-charts and infrastructure v6.5.0

Comments

@s1monw
Copy link

s1monw commented Aug 21, 2018

Elasticsearch will expose max_concurrent_shard_requests in _msearch in 6.5. In order to resolve issues like elastic/elasticsearch#31877 kibana should expose this setting to make sure environments with a low number of concurrent requests can tune dashboard performance by executing in parallel or at least make use of the available concurrency

The PR exposing max_concurrent_shard_requests in _msearch is here: elastic/elasticsearch#33016

@s1monw s1monw added the v6.5.0 label Aug 21, 2018
@s1monw
Copy link
Author

s1monw commented Aug 22, 2018

Quoting @epixa here:

It seems to me that that setting could be set Kibana-wide. I don’t see any reason to do it on a dashboard-by-dashboard basis, for example.Then courier would just add it to all msearches.

ping @elastic/kibana-discovery

@epixa
Copy link
Contributor

epixa commented Aug 22, 2018

I think we'll need to update elasticsearch-js to support an additional search parameter for msearch: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch cc @spalger

@Bargs
Copy link
Contributor

Bargs commented Aug 23, 2018

I looked into this and came to the same conclusion, elasticsearch.js will probably need an update. Once that's in place the update to Kibana should be simple. I'm not sure what the process is for generating the API modules in es.js so I'd need @spalger's help.

@spalger
Copy link
Contributor

spalger commented Aug 24, 2018

elasticsearch.js will be updated once the API spec is updated (and the script is rerun by @delvedor) but any unknown keys are passed through as query string parameters so changes to the client aren't required to start using this new parameter.

@s1monw
Copy link
Author

s1monw commented Aug 24, 2018

elasticsearch.js will be updated once the API spec is updated (and the script is rerun by @delvedor) but any unknown keys are passed through as query string parameters so changes to the client aren't required to start using this new parameter.

@spalger @Bargs the spec has been changed for 6.x and master. 2 days ago so I think you are just left with @delvedor running the script

@s1monw
Copy link
Author

s1monw commented Nov 27, 2018

@spalger @Bargs I learned today that there are multiple places in kibana that execute searches and not just msearch. I think this needs to be reopened and also passed to all different places where we search on elasticsearch?

@s1monw s1monw reopened this Nov 27, 2018
@spalger
Copy link
Contributor

spalger commented Nov 27, 2018

Hmm, max_concurrent_shard_requests needs to be set for every search request we do? That's a reasonable amount of work, we do searches in a lot of places.

@rayafratkina
Copy link
Contributor

rayafratkina commented Nov 27, 2018

cc @stacey-gammon @timroes
I think we should create separate issues for other places and prioritize them according to how important the change is in the relevant app

@timroes timroes added Feature:Search Querying infrastructure in Kibana Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed :Discovery labels Nov 27, 2018
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@s1monw
Copy link
Author

s1monw commented Nov 27, 2018

Hmm, max_concurrent_shard_requests needs to be set for every search request we do? That's a reasonable amount of work, we do searches in a lot of places.

my assumption when I opened the issue was that we only do msearch which caused the confusion. It think if we offer this we should to it across the board? Are the other places in kibana also hitting multiple indices?

@timroes
Copy link
Contributor

timroes commented Nov 27, 2018

Looking at the ES PR, that Simon linked (elastic/elasticsearch#33016), it seems this parameter is only relevant for _msearch. We're only using _msearch in Kibana in two places: Courier (where @Bargs already implemented that) and in TSVB.

So we still need to fix that in TSVB. The TSVB behavior might anyway change soon to using _search due to rollup support, so not sure if we should touch that now.

Looking through the code it seems that @elastic/infrastructure-ui is also using msearch so they should check if they are using that anywhere.

@spalger
Copy link
Contributor

spalger commented Nov 27, 2018

There are places like vega, timelion, tsvb, where the user can configure which indices to query that don't use our default search abstraction (courier). Other apps like monitoring, ML, maybe APM, Infraops, might need to incorporate a setting like this because they can query over arbitrary time ranges and I believe store their data in time based indices, while most of the time querying ES mostly direct.

Looking at the PR it seems this parameter is only relevant for _msearch.

@timroes I think that's what @s1monw is saying was a miscommunication in #22206 (comment)

@spalger
Copy link
Contributor

spalger commented Nov 27, 2018

@s1monw if we need to send this for every search request it makes me wonder why it's not a default configured in Elasticsearch?

@s1monw
Copy link
Author

s1monw commented Nov 27, 2018

@s1monw if we need to send this for every search request it makes me wonder why it's not a default configured in Elasticsearch?

this is a special case if you have for instance only a single node cluster you wanna max it out. The way how ES gains concurrency is on a request level this instead give you more concurrency per request. also you apparently only set it if the user sets it. so you are on-par with the default in ES. I think there are certain request parameters folks want access to so we should pass them on consistently.

@lukasolson
Copy link
Member

Closing this out. We are encouraging all applications and solutions to migrate to the data plugin search service, which properly sets this parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Search Querying infrastructure in Kibana Team:Visualizations Visualization editors, elastic-charts and infrastructure v6.5.0
Projects
None yet
Development

No branches or pull requests

8 participants