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

_msearch does not distirbute queries across the cluster #27775

Closed
alepuccetti opened this issue Dec 12, 2017 · 3 comments
Closed

_msearch does not distirbute queries across the cluster #27775

alepuccetti opened this issue Dec 12, 2017 · 3 comments

Comments

@alepuccetti
Copy link

alepuccetti commented Dec 12, 2017

I am running kibana dashboards and kibana uses _msearch to bundle all the queries of a dashboard in one request. I have 3 nodes and my dataset is one index with 1 primary shard and 2 replicas.

I would expect elasticsearch to distribute every query across the nodes but it does to load balance the queries. If I run all the queries separately using _search on the command line they are distributed across all nodes as expected and return much faster because it uses all the nodes instead of a single one.

I do not know if this is an expected behavior or a bug, but I believe that would be much better if elasticsearch would be able to multiplex queries submitted with _msearch across all the nodes to exploit the parallelism.

@jimczi
Copy link
Contributor

jimczi commented Dec 13, 2017

This is certainly due to the fact that Kibana adds a preference to the _msearch request that is sent to es. This preference is set to the session id of the Kibana user and ensures that all search inside a dashboard use the same shards/replicas:
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-preference.html
Without preference, _msearch just send each individual query independently so they could all potentially hit a different replica.

@jimczi jimczi closed this as completed Dec 13, 2017
@alepuccetti
Copy link
Author

@jimczi Thank you very much for the explanation. I was not aware of preferences. I was pretty confused about the fact that _msearch would not distribute queries, it seems very backward.

I will raise this issue on at the kibana repository.

@songlong
Copy link

msearch performance low concurrence request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants