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

Add priority to the threadpool #14224

Closed
gmoskovicz opened this issue Oct 21, 2015 · 10 comments
Closed

Add priority to the threadpool #14224

gmoskovicz opened this issue Oct 21, 2015 · 10 comments
Labels
:Core/Infra/Core Core issues without another label discuss

Comments

@gmoskovicz
Copy link
Contributor

When a bulk request is sent to elasticsearch, if there are other bulk operations simultaneously being sent there is no way to control how they will be handle, hence the requests will be handled randomly/automatically.

My proposal/question is about adding a priority parameter, which will be useful to set at the top of the queue/priority list those bulk (or any other requests) that are more important that the once that are being handled at some point.

@jpountz
Copy link
Contributor

jpountz commented Oct 21, 2015

Using a priority queue could help have some entries be taken out of the queue before others, but in the case that the problem is that the threadpool is already full with long-running bulk requests, this would not help as we would still have to wait for these long-running bulk requests to finish before being able to take a new one.

An alternative would be to have several threadpools but I don't like it as elasticsearch already creates hundreds of threads by default (see eg. #12666).

@clintongormley
Copy link

If your bulk queue is full, then having a priority just indicates which indexing requests you want to throw away first/last. This doesn't make much sense to me.

@ningjun
Copy link

ningjun commented Oct 29, 2015

I like the idea of having several bulk thread pools. This way user can set a dedicated thread pool to handle high priority bulk request.
This is a very useful feature and I think many customers would like to have this feature.

@Habitats
Copy link

Any progress on this?

@emilyfcy
Copy link

emilyfcy commented Jan 12, 2018

Is it possible to add priority to the search thread pool? We ran into the case that some of the search take long time, for example deep paging. Searching that in parallel might block all the rest search requests. So, it would be nice if we have limited low priority search pool to constraint the output of some searches that allows to be slow.

@jpountz
Copy link
Contributor

jpountz commented Jan 12, 2018

It is not possible. Plus I'd like to point out that fixing this is the search thread pool is not enough. For instance if an ongoing request is stealing all the I/O capacity of the machine, then other requests will be slow, regardless of what is done at the threadpool level.

@emilyfcy
Copy link

OK. If the bottleneck comes to CPU, it would be helpful. If it comes to others, like IO, cache, setting low priority on the threads might not be useful.

@clintongormley
Copy link

@emilyfcy See the max_concurrent_shard_requests setting which limits the number of concurrent shards that are searched by a single search request. This could fit your need.

@lcawl lcawl added :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. and removed :Bulk labels Feb 13, 2018
@dnhatn
Copy link
Member

dnhatn commented Mar 20, 2018

This feature request is an interesting idea but since its opening we have not seen enough feedback that it is a feature we should pursue. We prefer to close this issue as a clear indication that we are not going to work on this at this time. We are always open to reconsidering this in the future based on compelling feedback; despite this issue being closed please feel free to leave feedback on the proposal (including +1s).

@dnhatn dnhatn closed this as completed Mar 20, 2018
@jasontedor jasontedor added :Core/Infra/Core Core issues without another label and removed :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. labels Mar 20, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label discuss
Projects
None yet
Development

No branches or pull requests

10 participants