Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
add real size values (KBytes) of the DHT-In/Out-RAM-Caches to the PerformanceQueues page. A lot of users seem to tweak this value and it might help in finding the best size in relation to the peer's memory ressources.
fuchsi35303f95046e
diff --git a/htroot/PerformanceQueues_p.html b/htroot/PerformanceQueues_p.htmlindex 2140175a0..6d9a1d083 100644--- a/htroot/PerformanceQueues_p.html+++ b/htroot/PerformanceQueues_p.html@@ -84,9 +84,9 @@</td></tr><tr valign="top" class="TableCellDark">- <td>Words in RAM cache:</td>- <td>#[wordCacheWSize]#</td>- <td>#[wordCacheKSize]#</td>+ <td>Words in RAM cache:<br>(Size in KBytes)</td>+ <td>#[wordCacheWSize]#<br>(#[wordCacheWSizeKBytes]# KB)</td>+ <td>#[wordCacheKSize]#<br>(#[wordCacheKSizeKBytes]# KB)</td><td>This is the current size of the word caches.The indexing cache speeds up the indexing process, the DHT cache holds indexes temporary for approval.diff --git a/htroot/PerformanceQueues_p.java b/htroot/PerformanceQueues_p.javaindex 0f81f7875..992352b7a 100644--- a/htroot/PerformanceQueues_p.java+++ b/htroot/PerformanceQueues_p.java@@ -295,6 +295,8 @@ public class PerformanceQueues_p {prop.put("urlCacheSize", switchboard.wordIndex.loadedURL.writeCacheSize());prop.put("wordCacheWSize", switchboard.wordIndex.dhtOutCacheSize());prop.put("wordCacheKSize", switchboard.wordIndex.dhtInCacheSize());+ prop.putNum("wordCacheWSizeKBytes", switchboard.wordIndex.dhtCacheSizeBytes(false)/1024);+ prop.putNum("wordCacheKSizeKBytes", switchboard.wordIndex.dhtCacheSizeBytes(true)/1024);prop.put("maxURLinWCache", "" + switchboard.wordIndex.maxURLinDHTOutCache());prop.put("maxURLinKCache", "" + switchboard.wordIndex.maxURLinDHTInCache());prop.put("maxAgeOfWCache", "" + (switchboard.wordIndex.maxAgeOfDHTOutCache() / 1000 / 60)); // minutesdiff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.javaindex ad5a9db54..b632e6969 100644--- a/source/de/anomic/plasma/plasmaWordIndex.java+++ b/source/de/anomic/plasma/plasmaWordIndex.java@@ -125,6 +125,21 @@ public final class plasmaWordIndex implements indexRI {public int dhtInCacheSize() {return dhtInCache.size();}++ public long dhtCacheSizeBytes(boolean in) {+ // calculate the real size in bytes of DHT-In/Out-Cache+ long cacheBytes = 0;+ long entryBytes = indexRWIEntry.urlEntryRow.objectsize();+ indexRAMRI cache = (in ? dhtInCache : dhtOutCache);+ Iterator it = cache.wordContainers(null, false);+ indexContainer ic;+ while ( it.hasNext() ) {+ ic = (indexContainer)it.next();+ cacheBytes += ic.size() * entryBytes;+ }++ return cacheBytes;+ }public void setMaxWordCount(int maxWords) {dhtOutCache.setMaxWordCount(maxWords);@@ -520,7 +535,7 @@ public final class plasmaWordIndex implements indexRI {public synchronized kelondroCloneableIterator wordContainers(String startWordHash, boolean ram) {kelondroOrder containerOrder = new indexContainerOrder((kelondroOrder) indexOrder.clone());- containerOrder.rotate(startWordHash.getBytes());+ containerOrder.rotate(startWordHash.getBytes());if (ram) {return dhtOutCache.wordContainers(startWordHash, false);} else {