1717< h2 id ="container-worker-threads "> Container worker threads</ h2 >
1818< p >
1919 The container uses multiple thread pools for its operations.
20- Most components including request handlers use the container's < em > default thread pool</ em > ,
20+ Most components including request handlers use the container's
21+ < a href ="../reference/services-container.html#threadpool "> default thread pool</ a > ,
2122 which is controlled by a shared executor instance.
2223 Any component can utilize the default pool by injecting an < code > java.util.concurrent.Executor</ code > instance.
2324 Some built-in components have dedicated thread pools - such as the Jetty server, the
@@ -31,7 +32,8 @@ <h2 id="container-worker-threads">Container worker threads</h2>
3132 (< code > Runtime.getRuntime().availableProcessors()</ code > ).
3233 It's paramount that the < code > -XX:ActiveProcessorCount</ code > /< code > jvm_availableProcessors</ code >
3334 configuration is correct for the container to work optimally.
34- The default thread pool configuration can be overridden through services.xml.
35+ The < a href ="../reference/services-container.html#threadpool "> default thread pool</ a > configuration can be
36+ overridden through services.xml.
3537 We recommend you keep the default configuration as it's tuned to work across a variety of workloads.
3638 Note that the default configuration and pool usage may change between minor versions.
3739</ p >
@@ -83,6 +85,17 @@ <h3 id="container-worker-threads-example">Example</h3>
8385< pre > {% highlight xml %}
8486< container id ="container " version ="1.0 ">
8587
88+ <!-- The containers default thread pool -->
89+ < threadpool >
90+ <!-- Note: relative values -->
91+
92+ <!-- 5 threads per vcpu => 40 threads on 8 vcpu -->
93+ < threads max ="5 "> 5</ threads >
94+
95+ <!-- 25 queue slots per thread => 1000 entries on 8 vcpu -->
96+ < queue > 25</ queue >
97+ </ threadpool >
98+
8699 < search >
87100 <!-- Search handler thread pool -->
88101 < threadpool >
@@ -104,14 +117,6 @@ <h3 id="container-worker-threads-example">Example</h3>
104117 </ threadpool >
105118 </ document-processing >
106119
107- <!-- Default thread pool -->
108- < config name ="container.handler.threadpool ">
109- <!-- Set corePoolSize==maxthreads for fixed size pool (recommended) -->
110- <!-- Note: absolute pool size -->
111- < corePoolSize > 1000</ corePoolSize >
112- < maxthreads > 1000</ maxthreads >
113- </ config >
114-
115120</ container >
116121{% endhighlight %}</ pre >
117122
0 commit comments