Skip to content

Clarify queues in thread pool settings #127027

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

Merged

Conversation

DaveCTurner
Copy link
Contributor

The docs about the queue in a fixed pool are a little awkwardly
worded, and there is no mention of the queue in a scaling pool at all.
This commit cleans this area up.

The docs about the queue in a `fixed` pool are a little awkwardly
worded, and there is no mention of the queue in a `scaling` pool at all.
This commit cleans this area up.
@DaveCTurner DaveCTurner added >docs General docs changes :Core/Infra/Core Core issues without another label v9.1.0 labels Apr 17, 2025
@DaveCTurner DaveCTurner requested a review from leemthompo April 17, 2025 17:36
@elasticsearchmachine elasticsearchmachine added Team:Core/Infra Meta label for core/infra team Team:Docs Meta label for docs team labels Apr 17, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

The `size` parameter controls the number of threads.

The `queue_size` allows to control the size of the queue of pending requests that have no threads to execute them. By default, it is set to `-1` which means its unbounded. When a request comes in and the queue is full, it will abort the request.
A `fixed` thread pool holds a fixed number of threads as determined by the `size` parameter. If a task is submitted to a `fixed` thread pool and there are fewer than `size` busy threads in the pool then the task will execute immediately. If all the threads are busy when a task is submitted then it will be held in a queue for later execution. The `queue_size` parameter controls the maximum size of this queue. A `queue_size` of `-1` means that the queue is unbounded, but most `fixed` thread pools specify a bound on their queue size by default. If a bounded queue is full then it will reject further work, which typically causes the corresponding requests to fail.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does "by default" mean in this context?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E.g. the write pool specifies a default queue length of 10000, search_coordination has 1000, etc. You can override these if you want, but those are the defaults.

@DaveCTurner DaveCTurner merged commit 7e62862 into elastic:main Apr 17, 2025
6 checks passed
@DaveCTurner DaveCTurner deleted the 2025/04/17/thread-pool-settings-docs branch April 17, 2025 18:58
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 >docs General docs changes Team:Core/Infra Meta label for core/infra team Team:Docs Meta label for docs team v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants