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

Give higher priorities to fetch tasks than query tasks? #29366

Open
jpountz opened this issue Apr 4, 2018 · 8 comments
Open

Give higher priorities to fetch tasks than query tasks? #29366

jpountz opened this issue Apr 4, 2018 · 8 comments
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team

Comments

@jpountz
Copy link
Contributor

jpountz commented Apr 4, 2018

Under high search load, fetch tasks may have to wait quite some time in the queue before being processed. I was wondering that we might want to give them a higher priority than query tasks in order to minimize the amount of time during which we have to keep resources open at the shard level, such as the index reader, and the amount of time during which the coordinating node needs to keep shard responses in memory. However I wouldn't expect it to improve latency or throughput.

Note that while this might look related to #14224, this issue doesn't try to give some searches a higher priority than other searches, but to different tasks that are required to run a single search.

@jpountz jpountz added >enhancement discuss :Search/Search Search-related issues that do not fall into other categories labels Apr 4, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@jpountz
Copy link
Contributor Author

jpountz commented Apr 9, 2018

We discussed it further in FixitFriday and within the search team. Another option that was mentioned was to split tasks into two threadpools but we decided against it because we want to keep the number of threads contained, and decreasing the number of threads that query tasks can run in doesn't sound good either since some workloads consist only of query tasks.

So next steps would be the following:

  • add metrics regarding the amount of time during which we keep readers open after they have been replaced by a new reader (refresh)
  • try to introduce priorities for query vs fetch tasks, either by using some sort of priority queue or by wrapping 2 queues and taking from the one that contains fetch tasks first
  • benchmark with Rally

@jpountz jpountz added help wanted adoptme and removed discuss labels Apr 9, 2018
@atris
Copy link

atris commented Jan 14, 2019

Folks, I would like to take a crack at this. Could someone please assign it to me?

@WhiteBlackX6
Copy link

Hello, Can someone assign this to me? I would really like to contribute to this project.

@jpountz
Copy link
Contributor Author

jpountz commented Feb 12, 2019

For the record, I don't think this issue is a good first issue. You can search for issues with the "good first issue" label if you are looking for something to work on.

@atris
Copy link

atris commented Feb 14, 2019

@jpountz Could you share your thoughts on what kind of Rally workloads can trigger this? I have a half baked patch that I want to run through rally first and see how things are looking before moving ahead with the patch. I tried running http_logs, but it doesnt seem search heavy enough to warrant this behaviour.

@jpountz
Copy link
Contributor Author

jpountz commented Feb 14, 2019

Good question. This change would only matter if the search queue is not empty so we'd need to generate significant search load.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team
Projects
None yet
Development

No branches or pull requests

7 participants