-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
Reduce size of MANAGEMENT threadpool on small node #71171
Reduce size of MANAGEMENT threadpool on small node #71171
Conversation
Today by default the `MANAGEMENT` threadpool always permits 5 threads even if the node has a single CPU, which unfairly prioritises management activities on small nodes. With this commit we limit the size of this threadpool to the number of processors if less than 5. Relates elastic#70435
Pinging @elastic/es-distributed (Team:Distributed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
… don't need to schedule anything anyway
Darn it. This change results in deadlocks in the |
Darn it some more. |
@original-brownbear this has moved enough since your LGTM that it's worth another look. @elasticmachine test this please (just for another CI run in case it shakes out anything else before merging) |
once more with feeling ... @elasticmachine test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
// The delete by query request will be executed successfully because the block will be released | ||
assertThat(deleteByQuery().source("test").filter(QueryBuilders.matchAllQuery()).refresh(true).get(), | ||
matcher().deleted(docs)); | ||
// Fire off the delete-by-query first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this simplification, so just out of curiosity, did not changing this cause a failure? I need a hint to realize how I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the threadPool.schedule(..., ThreadPool.Names.MANAGEMENT)
made a blocking call on the (sole) management thread that could not complete because the refresh needs to make stats calls which also need management threads. I did a targeted fix in b8a20dd but then decided that the whole thing could be simplified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, got it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM2
Today by default the `MANAGEMENT` threadpool always permits 5 threads even if the node has a single CPU, which unfairly prioritises management activities on small nodes. With this commit we limit the size of this threadpool to the number of processors if less than 5. Relates #70435
Today by default the
MANAGEMENT
threadpool always permits 5 threadseven if the node has a single CPU, which unfairly prioritises management
activities on small nodes. With this commit we limit the size of this
threadpool to the number of processors if less than 5.
Relates #70435