Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
None
-
None
-
None
-
None
-
New
Description
maxThreadCount = Math.max(1, Math.min(4, coreCount / 2));
This has a practical limit of max of 4 threads due to the Math.min. This doesn't take into account higher coreCount.
I can't seem to tell if this is by design or this is just a mix up of logic during the calculation.
If I understand it looks like 1 and 4 are mixed up and should instead be:
maxThreadCount = Math.max(4, Math.min(1, coreCount / 2));
which then simplifies to
maxThreadCount = Math.max(4, coreCount / 2);
So that you have a minimum of 4 maxThreadCount and max of coreCount/2.
Based on the history I could find, this has been this way forever.
LUCENE-6437LUCENE-6119LUCENE-5951- Introduced as "maxThreadCount = Math.max(1, Math.min(3, Runtime.getRuntime().availableProcessors()/2));"
- https://github.com/apache/lucene/commit/33410e30c1af7105a6b8b922255af047d13be626#diff-ceb8ec6fe5807682cfb691a8ec52bcc672fb7c5eeb6922c80da4c075f7f003c8R147
Attachments
Issue Links
- relates to
-
LUCENE-5951 Detect when index is on SSD and set dynamic defaults
- Closed
-
LUCENE-6119 Add auto-io-throttle to ConcurrentMergeScheduler
- Closed
-
LUCENE-6437 Improve test reproducibility of ConcurrentMergeScheduler
- Closed
- links to