diff --git a/en/performance/container-tuning.html b/en/performance/container-tuning.html index 1808ea0591..e9790c7bf2 100644 --- a/en/performance/container-tuning.html +++ b/en/performance/container-tuning.html @@ -20,7 +20,9 @@

Container worker threads

Most components including request handlers use the container's default thread pool, which is controlled by a shared executor instance. Any component can utilize the default pool by injecting an java.util.concurrent.Executor instance. - Some built-in components have dedicated thread pools - such as the Jetty server and the search handler. + Some built-in components have dedicated thread pools - such as the Jetty server, the + search handler and + document-processing chains. These thread pools are injected through special wiring in the config model and are not easily accessible from other components.

@@ -36,8 +38,9 @@

Container worker threads

The container will pre-start the minimum number of worker threads, so even an idle container may report running several hundred threads. - The thread pool is pre-started with the number of thread specified in the - threads parameter. + The search handler and + document processing handler + thread pools each pre-start the number of workers set in their configurations. Note that tuning the capacity upwards increases the risk of high GC pressure as concurrency becomes higher with more in-flight requests. The GC pressure is a function of number of in-flight requests, the time it takes to complete the request @@ -45,9 +48,9 @@

Container worker threads

Increasing the queue size will allow the application to handle shorter traffic bursts without rejecting requests, although increasing the average latency for those requests that are queued up. Large queues will also increase heap consumption in overload situations. - Extra threads will be created once the queue is full (when - boost is specified), and are destroyed after an idle timeout. - If all threads are occupied, requests are rejected with a 503 response. + For some thread pools, extra threads will be created once the queue is full (when + boost is specified), and are destroyed + after an idle timeout. If all threads are occupied, requests are rejected with a 503 response.

The effective thread pool configuration and utilization statistics can be observed through the @@ -66,14 +69,6 @@

Recommendation

latency will increase as additional tasks are queued and launching extra threads is relatively expensive as it involves system calls to the OS.

-

Lower limit

-The container will override any configuration if the effective value is below a fixed minimum. This is to -reduce the risk of certain deadlock scenarios and improve concurrency for low-resource environments. - -

Example

{% highlight xml %}
 
@@ -91,6 +86,16 @@ 

Example

+ + + + + 4 + + 25 + + + diff --git a/en/reference/services-container.html b/en/reference/services-container.html index ee76b571cd..ce7122895a 100644 --- a/en/reference/services-container.html +++ b/en/reference/services-container.html @@ -35,6 +35,7 @@ include [dir] documentprocessor chain + threadpool processing include [dir] binding diff --git a/en/reference/services-docproc.html b/en/reference/services-docproc.html index 3e67cdc3bc..4a49106438 100644 --- a/en/reference/services-docproc.html +++ b/en/reference/services-docproc.html @@ -33,6 +33,7 @@ phase [id, idref, before, after] before after + threadpool

The root element of the document-processing configuration model.

@@ -294,3 +295,39 @@

Map

If you specify mappings on different levels of the config (say both for a cluster and a docproc), the mapping closest to the actual docproc will take precedence.

+ + +

threadpool

+

Available since {% include version.html version="8.601.12" %}

+

+ Configure the thread pool used by document processor chains. + All values scale with the number of vCPU. With <threads>4</threads> on an 8 vCPU host, + the pool runs with 32 worker threads. + + If also <queue>25</queue> is set, the thread pools queue capacity becomes queue * threads * vCPU, so + the queue can hold 800 items. Once all threads are busy and the queue is full, new document processing tasks are rejected. +

+ +

threads

+

+ Number of worker threads per vCPU. Default value is 1. + The configured pool size becomes threads * vCPU. +

+ +

queue

+

+ Size of the request queue per thread. + Default is an unlimited queue. + Specify 0 to disable queuing. + Else, the total queue size for thread pool becomes threads * vCPU * queue. +

+ +
{% highlight xml %}
+
+    
+        5
+        6
+    
+    
+
+{% endhighlight %}