LUCENE-10043: Decrease default LRUQueryCache#skipCacheFactor to 10 (#232)

In LUCENE-9002 we introduced logic to skip caching a clause if it would be too
expensive compared to the usual query cost. Specifically, we avoid caching a
clause if its cost is estimated to be a 250x higher than the lead iterator's.
We've found that the default of 250 is quite high and can lead to poor tail
latencies. This PR decreases it to 10 to cache more conservatively.
This commit is contained in:
Julie Tibshirani 2021-08-11 13:29:12 +03:00 committed by GitHub
parent 931ff63232
commit a9fb5a965d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -405,6 +405,10 @@ Improvements
* LUCENE-9945: Extend DrillSideways to support exposing FacetCollectors directly.
(Greg Miller, Sejal Pawar)
* LUCENE-10043: Decrease default for LRUQueryCache's skipCacheFactor to 10.
This prevents caching a query clause when it is much more expensive than
running the top-level query. (Julie Tibshirani)
Optimizations
---------------------
* LUCENE-9996: Improved memory efficiency of IndexWriter's RAM buffer, in

View File

@ -146,7 +146,7 @@ public class LRUQueryCache implements QueryCache, Accountable {
* of the top-level query will be cached in order to not hurt latency too much because of caching.
*/
public LRUQueryCache(int maxSize, long maxRamBytesUsed) {
this(maxSize, maxRamBytesUsed, new MinSegmentSizePredicate(10000, .03f), 250);
this(maxSize, maxRamBytesUsed, new MinSegmentSizePredicate(10000, .03f), 10);
}
// pkg-private for testing