diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index c44440e7e2b..ecdf5632acf 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -385,6 +385,10 @@ Optimizations * LUCENE-4598: PayloadIterator no longer uses top-level IndexReader to iterate on the posting's payload. (Shai Erera, Michael McCandless) + +* LUCENE-4661: Drop default maxThreadCount to 1 and maxMergeCount to 2 + in ConcurrentMergeScheduler, for faster merge performance on + spinning-magnet drives (Mike McCandless) Documentation diff --git a/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java b/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java index 197846d9d93..60b655c5daa 100644 --- a/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java +++ b/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java @@ -55,14 +55,15 @@ public class ConcurrentMergeScheduler extends MergeScheduler { // forcefully pause the larger ones, letting the smaller // ones run, up until maxMergeCount merges at which point // we forcefully pause incoming threads (that presumably - // are the ones causing so much merging). We dynamically - // default this from 1 to 3, depending on how many cores - // you have: - private int maxThreadCount = Math.max(1, Math.min(3, Runtime.getRuntime().availableProcessors()/2)); + // are the ones causing so much merging). We default to 1 + // here: tests on spinning-magnet drives showed slower + // indexing perf if more than one merge thread runs at + // once (though on an SSD it was faster): + private int maxThreadCount = 1; // Max number of merges we accept before forcefully // throttling the incoming threads - private int maxMergeCount = maxThreadCount+2; + private int maxMergeCount = 2; /** {@link Directory} that holds the index. */ protected Directory dir;