From 2b32e623e4e0e2b6e07ead57b020a1840613f604 Mon Sep 17 00:00:00 2001 From: David Turner Date: Thu, 17 Apr 2025 18:35:02 +0100 Subject: [PATCH] Clarify queues in thread pool settings 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. --- .../configuration-reference/thread-pool-settings.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/reference/elasticsearch/configuration-reference/thread-pool-settings.md b/docs/reference/elasticsearch/configuration-reference/thread-pool-settings.md index 7a52376ef9b7a..6c754ec160da2 100644 --- a/docs/reference/elasticsearch/configuration-reference/thread-pool-settings.md +++ b/docs/reference/elasticsearch/configuration-reference/thread-pool-settings.md @@ -94,11 +94,7 @@ The following are the types of thread pools and their respective parameters: ### `fixed` [fixed-thread-pool] -The `fixed` thread pool holds a fixed size of threads to handle the requests with a queue (optionally bounded) for pending requests that have no threads to service them. - -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. ```yaml thread_pool: @@ -114,6 +110,8 @@ The `scaling` thread pool holds a dynamic number of threads. This number is prop The `keep_alive` parameter determines how long a thread should be kept around in the thread pool without it doing any work. +If a task is submitted to a `scaling` thread pool when its maximum number of threads are already busy with other tasks, the new task will be held in a queue for later execution. The queue in a `scaling` thread pool is always unbounded. + ```yaml thread_pool: warmer: