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.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4169 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
fuchsi 17 years ago
parent a9aef8e5e0
commit 35303f9504

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

@ -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)); // minutes

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

Loading…
Cancel
Save