You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/07/26 16:37:49 UTC

[lucene-solr] branch reference_impl updated: @347 Did someone call a doctor?

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/reference_impl by this push:
     new 5c35b98  @347 Did someone call a doctor?
5c35b98 is described below

commit 5c35b981765ca97fd21b48eac0ac5665f7dfad10
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Sun Jul 26 11:37:16 2020 -0500

    @347 Did someone call a doctor?
---
 solr/core/src/java/org/apache/solr/servlet/SolrQoSFilter.java    | 6 +++---
 solr/core/src/test/org/apache/solr/CursorPagingTest.java         | 4 ++--
 .../src/test/org/apache/solr/search/TestStressUserVersions.java  | 9 +++------
 solr/solrj/src/java/org/apache/solr/common/ParWork.java          | 7 ++++---
 solr/test-framework/src/java/org/apache/solr/SolrTestCase.java   | 2 +-
 5 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrQoSFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrQoSFilter.java
index c8b9cc8..9a5e6b8 100644
--- a/solr/core/src/java/org/apache/solr/servlet/SolrQoSFilter.java
+++ b/solr/core/src/java/org/apache/solr/servlet/SolrQoSFilter.java
@@ -48,10 +48,10 @@ public class SolrQoSFilter extends QoSFilter {
   @Override
   public void init(FilterConfig filterConfig) {
     super.init(filterConfig);
-    _origMaxRequests = Integer.getInteger("solr.MaxConcurrentRequests", 300);
+    _origMaxRequests = Integer.getInteger("solr.concurrentRequests.max", 1000);
     super.setMaxRequests(_origMaxRequests);
-    super.setSuspendMs(15000);
-    super.setWaitMs(500);
+    super.setSuspendMs(Integer.getInteger("solr.concurrentRequests.suspendms", 10000));
+    super.setWaitMs(Integer.getInteger("solr.concurrentRequests.waitms", 500));
   }
 
   @Override
diff --git a/solr/core/src/test/org/apache/solr/CursorPagingTest.java b/solr/core/src/test/org/apache/solr/CursorPagingTest.java
index 71a810e..9161c14 100644
--- a/solr/core/src/test/org/apache/solr/CursorPagingTest.java
+++ b/solr/core/src/test/org/apache/solr/CursorPagingTest.java
@@ -560,8 +560,8 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
   public void testRandomSortsOnLargeIndex() throws Exception {
     final Collection<String> allFieldNames = getAllSortFieldNames();
 
-    final int initialDocs = TestUtil.nextInt(random(), 100, TEST_NIGHTLY ? 200 : 130);
-    final int totalDocs = TEST_NIGHTLY ? atLeast(500) : 150;
+    final int initialDocs = TestUtil.nextInt(random(), 100, TEST_NIGHTLY ? 200 : 115);
+    final int totalDocs = TEST_NIGHTLY ? atLeast(500) : 120;
 
     // start with a smallish number of documents, and test that we can do a full walk using a 
     // sort on *every* field in the schema...
diff --git a/solr/core/src/test/org/apache/solr/search/TestStressUserVersions.java b/solr/core/src/test/org/apache/solr/search/TestStressUserVersions.java
index 7904b6d..76be027 100644
--- a/solr/core/src/test/org/apache/solr/search/TestStressUserVersions.java
+++ b/solr/core/src/test/org/apache/solr/search/TestStressUserVersions.java
@@ -71,18 +71,18 @@ public class TestStressUserVersions extends TestRTGBase {
     clearIndex();
     assertU(commit());
 
-    final int commitPercent = 5 + random().nextInt(20);
+    final int commitPercent = 5 + random().nextInt(TEST_NIGHTLY ? 20 : 3);
     final int softCommitPercent = 30+random().nextInt(75); // what percent of the commits are soft
     final int deletePercent = 4+random().nextInt(25);
     final int deleteByQueryPercent = random().nextInt(8);
-    final int ndocs = 5 + (random().nextBoolean() ? random().nextInt(25) : random().nextInt(200));
+    final int ndocs = 5 + (TEST_NIGHTLY ? (random().nextBoolean() ? random().nextInt(25) : random().nextInt(200)) : 7);
     int nWriteThreads = 1 + random().nextInt(TEST_NIGHTLY ? 12 : 2);
 
     final int maxConcurrentCommits = nWriteThreads;
 
     // query variables
     final int percentRealtimeQuery = 75;
-    final AtomicLong operations = new AtomicLong( TEST_NIGHTLY ? 10000 : 100);  // number of query operations to perform in total - ramp up for a longer test
+    final AtomicLong operations = new AtomicLong( TEST_NIGHTLY ? 10000 : 75);  // number of query operations to perform in total - ramp up for a longer test
     int nReadThreads = 1 + random().nextInt(TEST_NIGHTLY ? 12 : 2);
 
 
@@ -316,10 +316,7 @@ public class TestStressUserVersions extends TestRTGBase {
       threads.add(thread);
     }
 
-
-
     testExecutor.invokeAll(threads);
-
   }
 
 }
diff --git a/solr/solrj/src/java/org/apache/solr/common/ParWork.java b/solr/solrj/src/java/org/apache/solr/common/ParWork.java
index 04739a4..86883c7 100644
--- a/solr/solrj/src/java/org/apache/solr/common/ParWork.java
+++ b/solr/solrj/src/java/org/apache/solr/common/ParWork.java
@@ -67,6 +67,7 @@ public class ParWork implements Closeable {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   protected final static ThreadLocal<ExecutorService> THREAD_LOCAL_EXECUTOR = new ThreadLocal<>();
+  public static final int MIN_THREADS = 3;
 
   private Set<Object> collectSet = null;
 
@@ -590,14 +591,14 @@ public class ParWork implements Closeable {
     if (ourLoad > 1) {
       int cMax = executor.getMaximumPoolSize();
       if (cMax > 2) {
-        executor.setMaximumPoolSize(Math.max(2, (int) ((double)cMax * 0.60D)));
+        executor.setMaximumPoolSize(Math.max(MIN_THREADS, (int) ((double)cMax * 0.60D)));
       }
     } else {
       double sLoad = load / (double) PROC_COUNT;
       if (sLoad > 1.0D) {
         int cMax =  executor.getMaximumPoolSize();
         if (cMax > 2) {
-          executor.setMaximumPoolSize(Math.max(2, (int) ((double) cMax * 0.60D)));
+          executor.setMaximumPoolSize(Math.max(MIN_THREADS, (int) ((double) cMax * 0.60D)));
         }
       } else if (sLoad < 0.9D && maxPoolsSize != executor.getMaximumPoolSize()) {
         executor.setMaximumPoolSize(maxPoolsSize);
@@ -631,7 +632,7 @@ public class ParWork implements Closeable {
 
   private static Integer getMaxPoolSize() {
     return Integer.getInteger("solr.maxThreadExecPoolSize",
-            (int) Math.max(4, Math.round(Runtime.getRuntime().availableProcessors() / 3)));
+            (int) Math.max(MIN_THREADS, Math.round(Runtime.getRuntime().availableProcessors() / 3)));
   }
 
   private void handleObject(String label, AtomicReference<Throwable> exception, final TimeTracker workUnitTracker, Object object) {
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
index a744163..964c916 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
@@ -209,7 +209,7 @@ public class SolrTestCase extends LuceneTestCase {
 //      System.setProperty("solr.tests.DateFieldType", "org.apache.solr.schema.DatePointField");
 //      System.setProperty("solr.tests.EnumFieldType", "org.apache.solr.schema.EnumFieldType");
 
-      System.setProperty("solr.MaxConcurrentRequests", "5");
+      System.setProperty("solr.concurrentRequests.max", "5");
       System.setProperty("solr.tests.infostream", "false");
       System.setProperty("numVersionBuckets", "8192");