diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
index b36f1c18977..fc0fac78156 100644
--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java
+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
@@ -442,7 +442,9 @@ public CoreContainer(NodeConfig config, CoresLocator locator, boolean asyncSolrC
this.collectorExecutor =
ExecutorUtil.newMDCAwareCachedThreadPool(
- 6, 6, new SolrNamedThreadFactory("searcherCollector"));
+ cfg.getIndexSearcherExecutorThreads(), // thread count
+ cfg.getIndexSearcherExecutorThreads(), // queue size
+ new SolrNamedThreadFactory("searcherCollector"));
}
@SuppressWarnings({"unchecked"})
diff --git a/solr/core/src/java/org/apache/solr/core/NodeConfig.java b/solr/core/src/java/org/apache/solr/core/NodeConfig.java
index ef1cbbf2dfd..fa38b70410d 100644
--- a/solr/core/src/java/org/apache/solr/core/NodeConfig.java
+++ b/solr/core/src/java/org/apache/solr/core/NodeConfig.java
@@ -105,6 +105,8 @@ public class NodeConfig {
private final int replayUpdatesThreads;
+ private final int indexSearcherExecutorThreads;
+
@Deprecated private final int transientCacheSize;
private final boolean useSchemaCache;
@@ -144,6 +146,7 @@ private NodeConfig(
CloudConfig cloudConfig,
Integer coreLoadThreads,
int replayUpdatesThreads,
+ int indexSearcherExecutorThreads,
int transientCacheSize,
boolean useSchemaCache,
String managementPath,
@@ -183,6 +186,7 @@ private NodeConfig(
this.cloudConfig = cloudConfig;
this.coreLoadThreads = coreLoadThreads;
this.replayUpdatesThreads = replayUpdatesThreads;
+ this.indexSearcherExecutorThreads = indexSearcherExecutorThreads;
this.transientCacheSize = transientCacheSize;
this.useSchemaCache = useSchemaCache;
this.managementPath = managementPath;
@@ -335,6 +339,10 @@ public int getReplayUpdatesThreads() {
return replayUpdatesThreads;
}
+ public int getIndexSearcherExecutorThreads() {
+ return indexSearcherExecutorThreads;
+ }
+
/**
* Returns a directory, optionally a comma separated list of directories that will be added to
* Solr's class path for searching for classes and plugins. The path is either absolute or
@@ -597,6 +605,7 @@ public static class NodeConfigBuilder {
private CloudConfig cloudConfig;
private int coreLoadThreads = DEFAULT_CORE_LOAD_THREADS;
private int replayUpdatesThreads = Runtime.getRuntime().availableProcessors();
+ private int indexSearcherExecutorThreads = DEFAULT_INDEX_SEARCHER_EXECUTOR_THREADS;
@Deprecated private int transientCacheSize = -1;
private boolean useSchemaCache = false;
private String managementPath;
@@ -618,6 +627,9 @@ public static class NodeConfigBuilder {
// No:of core load threads in cloud mode is set to a default of 8
public static final int DEFAULT_CORE_LOAD_THREADS_IN_CLOUD = 8;
+ public static final int DEFAULT_INDEX_SEARCHER_EXECUTOR_THREADS =
+ 6; // TODO: what should the default be?
+
private static final String DEFAULT_CORESLOCATORCLASS =
"org.apache.solr.core.CorePropertiesLocator";
private static final String DEFAULT_CORESORTERCLASS = "org.apache.solr.core.CoreSorter";
@@ -755,6 +767,11 @@ public NodeConfigBuilder setReplayUpdatesThreads(int replayUpdatesThreads) {
return this;
}
+ public NodeConfigBuilder setIndexSearcherExecutorThreads(int indexSearcherExecutorThreads) {
+ this.indexSearcherExecutorThreads = indexSearcherExecutorThreads;
+ return this;
+ }
+
// Remove in Solr 10.0
@Deprecated
@@ -904,6 +921,7 @@ public NodeConfig build() {
cloudConfig,
coreLoadThreads,
replayUpdatesThreads,
+ indexSearcherExecutorThreads,
transientCacheSize,
useSchemaCache,
managementPath,
diff --git a/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java b/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java
index 4c15cd9b7a9..9e616004ff5 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java
@@ -380,6 +380,9 @@ private static NodeConfig fillSolrSection(NodeConfig.NodeConfigBuilder builder,
case "replayUpdatesThreads":
builder.setReplayUpdatesThreads(it.intVal(-1));
break;
+ case "indexSearcherExecutorThreads":
+ builder.setIndexSearcherExecutorThreads(it.intVal(-1));
+ break;
case "transientCacheSize":
log.warn("solr.xml transientCacheSize -- transient cores is deprecated");
builder.setTransientCacheSize(it.intVal(-1));
diff --git a/solr/core/src/test-files/solr/solr-50-all.xml b/solr/core/src/test-files/solr/solr-50-all.xml
index efa2abd4e6a..53a682050ca 100644
--- a/solr/core/src/test-files/solr/solr-50-all.xml
+++ b/solr/core/src/test-files/solr/solr-50-all.xml
@@ -30,6 +30,7 @@
testCoreSorter
66
100
+ 7
42
true
diff --git a/solr/core/src/test/org/apache/solr/core/TestSolrXml.java b/solr/core/src/test/org/apache/solr/core/TestSolrXml.java
index 5454baceb86..9509bb98eb3 100644
--- a/solr/core/src/test/org/apache/solr/core/TestSolrXml.java
+++ b/solr/core/src/test/org/apache/solr/core/TestSolrXml.java
@@ -86,6 +86,7 @@ public void testAllInfoPresent() throws IOException {
assertEquals("core sorter class", "testCoreSorter", cfg.getCoreSorterClass());
assertEquals("core load threads", 11, cfg.getCoreLoadThreadCount(false));
assertEquals("replay update threads", 100, cfg.getReplayUpdatesThreads());
+ assertEquals("index searcher executor threads", 7, cfg.getIndexSearcherExecutorThreads());
MatcherAssert.assertThat(
"core root dir",
cfg.getCoreRootDirectory().toString(),
diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solr-xml.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solr-xml.adoc
index ed169b989e7..d3a8f2a79a5 100644
--- a/solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solr-xml.adoc
+++ b/solr/solr-ref-guide/modules/configuration-guide/pages/configuring-solr-xml.adoc
@@ -178,6 +178,15 @@ Specifies the number of threads that will be assigned to replay updates in paral
This pool is shared for all cores of the node.
The default value is equal to the number of processors.
+`indexSearcherExecutorThreads`::
++
+[%autowidth,frame=none]
+|===
+|Optional |Default: ???
+|===
++
+Specifies the number of threads that will be assigned to ...
+
`coreRootDirectory`::
+
[%autowidth,frame=none]