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 18 years ago
parent a9aef8e5e0
commit 35303f9504

@ -84,9 +84,9 @@
</td> </td>
</tr> </tr>
<tr valign="top" class="TableCellDark"> <tr valign="top" class="TableCellDark">
<td>Words in RAM cache:</td> <td>Words in RAM cache:<br>(Size in KBytes)</td>
<td>#[wordCacheWSize]#</td> <td>#[wordCacheWSize]#<br>(#[wordCacheWSizeKBytes]# KB)</td>
<td>#[wordCacheKSize]#</td> <td>#[wordCacheKSize]#<br>(#[wordCacheKSizeKBytes]# KB)</td>
<td> <td>
This is the current size of the word caches. 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. 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("urlCacheSize", switchboard.wordIndex.loadedURL.writeCacheSize());
prop.put("wordCacheWSize", switchboard.wordIndex.dhtOutCacheSize()); prop.put("wordCacheWSize", switchboard.wordIndex.dhtOutCacheSize());
prop.put("wordCacheKSize", switchboard.wordIndex.dhtInCacheSize()); 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("maxURLinWCache", "" + switchboard.wordIndex.maxURLinDHTOutCache());
prop.put("maxURLinKCache", "" + switchboard.wordIndex.maxURLinDHTInCache()); prop.put("maxURLinKCache", "" + switchboard.wordIndex.maxURLinDHTInCache());
prop.put("maxAgeOfWCache", "" + (switchboard.wordIndex.maxAgeOfDHTOutCache() / 1000 / 60)); // minutes prop.put("maxAgeOfWCache", "" + (switchboard.wordIndex.maxAgeOfDHTOutCache() / 1000 / 60)); // minutes

@ -126,6 +126,21 @@ public final class plasmaWordIndex implements indexRI {
return dhtInCache.size(); 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) { public void setMaxWordCount(int maxWords) {
dhtOutCache.setMaxWordCount(maxWords); dhtOutCache.setMaxWordCount(maxWords);
dhtInCache.setMaxWordCount(maxWords); dhtInCache.setMaxWordCount(maxWords);

Loading…
Cancel
Save