LUCENE-4661: lower default maxThread/MergeCount in CMS

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1429616 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2013-01-06 23:53:34 +00:00
parent b9a3d9ca70
commit fa59580879
2 changed files with 10 additions and 5 deletions

View File

@ -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

View File

@ -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;