From 78eac851619079baa6a524050dbcc357abd02523 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Wed, 4 Dec 2013 23:15:10 +0100 Subject: [PATCH] better calibration of caches and queue maximum sizes --- source/net/yacy/search/index/Segment.java | 2 +- source/net/yacy/search/query/SearchEvent.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/net/yacy/search/index/Segment.java b/source/net/yacy/search/index/Segment.java index c90151822..c7e0e0183 100644 --- a/source/net/yacy/search/index/Segment.java +++ b/source/net/yacy/search/index/Segment.java @@ -143,7 +143,7 @@ public class Segment { new String[] {}, this, "putDocument", - 10, + 30, null, 1); } diff --git a/source/net/yacy/search/query/SearchEvent.java b/source/net/yacy/search/query/SearchEvent.java index 0b0af1044..e4be9ec6e 100644 --- a/source/net/yacy/search/query/SearchEvent.java +++ b/source/net/yacy/search/query/SearchEvent.java @@ -99,8 +99,9 @@ import net.yacy.search.snippet.TextSnippet.ResultClass; import org.apache.solr.common.SolrDocument; public final class SearchEvent { - + private static final int max_results_rwi = 3000; + private static final int max_results_node = 150; /* private static long noRobinsonLocalRWISearch = 0; @@ -219,7 +220,7 @@ public final class SearchEvent { this.workTables = workTables; this.query = query; this.loader = loader; - this.nodeStack = new WeakPriorityBlockingQueue(100, false); + this.nodeStack = new WeakPriorityBlockingQueue(max_results_node, false); this.maxExpectedRemoteReferences = new AtomicInteger(0); this.expectedRemoteReferences = new AtomicInteger(0); this.excludeintext_image = Switchboard.getSwitchboard().getConfigBool("search.excludeintext.image", true); @@ -391,7 +392,7 @@ public final class SearchEvent { this.deleteIfSnippetFail = deleteIfSnippetFail; this.urlRetrievalAllTime = 0; this.snippetComputationAllTime = 0; - this.resultList = new WeakPriorityBlockingQueue(Math.max(1000, 10 * query.itemsPerPage()), true); // this is the result, enriched with snippets, ranked and ordered by ranking + this.resultList = new WeakPriorityBlockingQueue(Math.max(max_results_node, 10 * query.itemsPerPage()), true); // this is the result, enriched with snippets, ranked and ordered by ranking // snippets do not need to match with the complete query hashes, // only with the query minus the stopwords which had not been used for the search