You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by cp...@apache.org on 2024/07/24 13:29:55 UTC
(solr) branch branch_9x updated: SOLR-13350: multi-threaded search: default to 'available processors' thread count (#2569)
This is an automated email from the ASF dual-hosted git repository.
cpoerschke pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new 8b3d5b0f571 SOLR-13350: multi-threaded search: default to 'available processors' thread count (#2569)
8b3d5b0f571 is described below
commit 8b3d5b0f57160d61b5b7510049a7235413df03ae
Author: Christine Poerschke <cp...@apache.org>
AuthorDate: Wed Jul 24 14:27:36 2024 +0100
SOLR-13350: multi-threaded search: default to 'available processors' thread count (#2569)
Co-authored-by: Ishan Chattopadhyaya <is...@apache.org>
Co-authored-by: Gus Heck <46...@users.noreply.github.com>
(cherry picked from commit ffde4199a094136bde4f63ca4037b05f6388e488)
---
solr/bin/solr | 3 ---
solr/core/src/java/org/apache/solr/core/NodeConfig.java | 4 +++-
solr/server/solr/solr.xml | 1 -
.../modules/configuration-guide/pages/configuring-solr-xml.adoc | 2 +-
4 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/solr/bin/solr b/solr/bin/solr
index 29fb7426e16..cb1612d7e9c 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -1696,9 +1696,6 @@ if [ $# -gt 0 ]; then
done
fi
-# Setting number of threads for search
-if ! command -v nproc &> /dev/null; then echo "Couldn't determine number of CPUs, using default number of search threads"; else cpus=`nproc`; SCRIPT_SOLR_OPTS+="-Dsolr.searchThreads=$cpus"; fi
-
# Default placement plugin
if [[ -n "${SOLR_PLACEMENTPLUGIN_DEFAULT:-}" ]] ; then
SCRIPT_SOLR_OPTS+=("-Dsolr.placementplugin.default=$SOLR_PLACEMENTPLUGIN_DEFAULT")
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 f9631f619b4..48dab86dff8 100644
--- a/solr/core/src/java/org/apache/solr/core/NodeConfig.java
+++ b/solr/core/src/java/org/apache/solr/core/NodeConfig.java
@@ -679,7 +679,9 @@ public class NodeConfig {
// 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 = 4;
+ public static final int DEFAULT_INDEX_SEARCHER_EXECUTOR_THREADS =
+ Runtime.getRuntime().availableProcessors();
+ ;
private static final String DEFAULT_CORESLOCATORCLASS =
"org.apache.solr.core.CorePropertiesLocator";
diff --git a/solr/server/solr/solr.xml b/solr/server/solr/solr.xml
index ed1f876759d..afcd6eaa238 100644
--- a/solr/server/solr/solr.xml
+++ b/solr/server/solr/solr.xml
@@ -34,7 +34,6 @@
<str name="allowPaths">${solr.allowPaths:}</str>
<str name="allowUrls">${solr.allowUrls:}</str>
<str name="hideStackTrace">${solr.hideStackTrace:false}</str>
- <int name="indexSearcherExecutorThreads">${solr.searchThreads:4}</int>
<solrcloud>
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 27cd3e94640..c324600d0ce 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
@@ -184,7 +184,7 @@ The default value is equal to the number of processors.
+
[%autowidth,frame=none]
|===
-|Optional |Default: 4
+|Optional |Default: number of available processors
|===
+
Specifies the number of threads that will be assigned for search queries.