Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
integrated and extended new memory performance menu; found and fixed bug in DHT caching
orbiter71a31f09026d
diff --git a/htroot/PerformanceMemory_p.html b/htroot/PerformanceMemory_p.htmlindex 78fd2aac6..2d6b81d78 100644--- a/htroot/PerformanceMemory_p.html+++ b/htroot/PerformanceMemory_p.html@@ -6,21 +6,40 @@</head><body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">#[header]#-<br><br>+#[submenuPerformance]#+<br><h2>Performance Settings for Memory</h2>++<p>+<div class=small><b>Available Memory:</b></div>+<table border="0" cellpadding="2" cellspacing="1">+<tr class="TableHeader" valign="bottom">+<td class="small">After Startup</td>+<td class="small">After Initializations</td>+<td class="small">Now</td>+</tr>++<tr class="TableCellDark">+<td class="small" align="right">#[memoryFreeAfterStartup]# bytes</td>+<td class="small" align="right">#[memoryFreeAfterInit]# bytes</td>+<td class="small" align="right">#[memoryFreeNow]# bytes</td>+</tr>+</table>+</p>+<p><div class=small><b>RAM Cache for Database Files:</b></div><table border="0" cellpadding="2" cellspacing="1"><form action="PerformanceMemory_p.html" method="post" enctype="multipart/form-data"><tr class="TableHeader" valign="bottom"><td class="small">Database<br></td>-<td class="small">Chunk Size<br>(bytes)</td>-<td class="small">#Needed Slots<br>(= DB Size)</td>-<td class="small">#Empty Slots<br> </td>-<td class="small">#Used Slots<br>High Priority</td>-<td class="small">#Used Slots<br>Medium Priority</td>-<td class="small">#Used Slots<br>Low Priority</td>+<td class="small">Chunk Size<br>(bytes)</td>+<td class="small">#Needed Slots<br>(= DB Size)</td>+<td class="small">#Empty Slots<br> </td>+<td class="small">#Used Slots<br>High Priority</td>+<td class="small">#Used Slots<br>Medium Priority</td>+<td class="small">#Used Slots<br>Low Priority</td><td class="small">Used<br>Size</td><td class="small">Assigned<br>Max-Size</td><td class="small">Recommended<br>Max-Size</td>diff --git a/htroot/PerformanceMemory_p.java b/htroot/PerformanceMemory_p.javaindex a20770e70..a4ee2500a 100644--- a/htroot/PerformanceMemory_p.java+++ b/htroot/PerformanceMemory_p.java@@ -81,13 +81,22 @@ public class PerformanceMemory_p {sb.setConfig("ramCacheNews", post.get("ramCacheNews", "0"));}+ System.gc();+ long memoryFreeNow = Runtime.getRuntime().freeMemory();+ long memoryFreeAfterInit = Long.parseLong(sb.getConfig("memoryFreeAfterInit", "0"));+ long memoryFreeAfterStartup = Long.parseLong(sb.getConfig("memoryFreeAfterStartup", "0"));++ prop.put("memoryFreeNow", memoryFreeNow);+ prop.put("memoryFreeAfterInit", memoryFreeAfterInit);+ prop.put("memoryFreeAfterStartup", memoryFreeAfterStartup);+req = switchboard.wordIndex.size();chk = switchboard.wordIndex.assortmentsCacheChunkSizeAvg();slt = switchboard.wordIndex.assortmentsCacheFillStatusCml();calc(); putprop(prop, "RWI");prop.put("ramCacheRWI", sb.getConfig("ramCacheRWI", "0"));- req = switchboard.cacheManager.size();+ req = switchboard.cacheManager.dbSize();chk = switchboard.cacheManager.dbCacheChunkSize();slt = switchboard.cacheManager.dbCacheFillStatus();calc(); putprop(prop, "HTTP");diff --git a/htroot/PerformanceQueues_p.html b/htroot/PerformanceQueues_p.htmlindex a28e2a689..3de7f221f 100644--- a/htroot/PerformanceQueues_p.html+++ b/htroot/PerformanceQueues_p.html@@ -6,8 +6,10 @@</head><body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">#[header]#-<br><br>+#[submenuPerformance]#+<br><h2>Performance Settings of Queues and Processes</h2>+<p><div class=small><b>Scheduled tasks overview and waiting time settings:</b></div><table border="0" cellpadding="2" cellspacing="1">diff --git a/htroot/env/templates/submenuPerformance.template b/htroot/env/templates/submenuPerformance.templatenew file mode 100644index 000000000..94f8032f8--- /dev/null+++ b/htroot/env/templates/submenuPerformance.template@@ -0,0 +1,11 @@+<table width="100%" border="0" cellpadding="0" cellspacing="0" class="SubMenu">+<tr height="10"><td colspan="17" class="MenuHeader"> Performance Menu</td></tr>+<tr height="2"><td colspan="17"></td></tr>+<tr class="TableHeader">+<td width="50%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> +<a href="/PerformanceQueues_p.html" class="MenuItemLink">Queues Performance Settings</a> </td>+<td class="MenuSubSpacer"></td>+<td width="50%" class="MenuSubItem"> <img border="0" src="/env/grafics/lock.gif" align="top"> +<a href="/PerformanceMemory_p.html" class="MenuItemLink">Memory Settings for Database Caches</a> </td>+</tr>+</table>\ No newline at end of filediff --git a/source/de/anomic/plasma/plasmaHTCache.java b/source/de/anomic/plasma/plasmaHTCache.javaindex 62bb75bbd..100a5bd2a 100644--- a/source/de/anomic/plasma/plasmaHTCache.java+++ b/source/de/anomic/plasma/plasmaHTCache.java@@ -135,6 +135,10 @@ public final class plasmaHTCache {}}+ public int dbSize() {+ return responseHeaderDB.size();+ }+public int dbCacheChunkSize() {return responseHeaderDB.cacheChunkSize();}diff --git a/source/de/anomic/yacy/yacySeedDB.java b/source/de/anomic/yacy/yacySeedDB.javaindex 86806d566..3cd67166f 100644--- a/source/de/anomic/yacy/yacySeedDB.java+++ b/source/de/anomic/yacy/yacySeedDB.java@@ -96,6 +96,7 @@ public final class yacySeedDB {File seedPotentialDBFile,int bufferkb) throws IOException {+ this.seedDBBufferKB = bufferkb;this.seedActiveDBFile = seedActiveDBFile;this.seedPassiveDBFile = seedPassiveDBFile;this.seedPotentialDBFile = seedPotentialDBFile;@@ -161,7 +162,7 @@ public final class yacySeedDB {private synchronized kelondroMap openSeedTable(File seedDBFile) throws IOException {if (seedDBFile.exists()) try {// open existing seed database- return new kelondroMap(new kelondroDyn(seedDBFile, seedDBBufferKB/3 * 0x400), sortFields, accFields);+ return new kelondroMap(new kelondroDyn(seedDBFile, (seedDBBufferKB * 0x400) / 3), sortFields, accFields);} catch (kelondroException e) {// if we have an error, we start with a fresh databaseif (seedDBFile.exists()) seedDBFile.delete();@@ -171,7 +172,7 @@ public final class yacySeedDB {}// create new seed databasenew File(seedDBFile.getParent()).mkdir();- return new kelondroMap(new kelondroDyn(seedDBFile, seedDBBufferKB/3 * 0x400, commonHashLength, 480), sortFields, accFields);+ return new kelondroMap(new kelondroDyn(seedDBFile, (seedDBBufferKB * 0x400) / 3, commonHashLength, 480), sortFields, accFields);}private synchronized kelondroMap resetSeedTable(kelondroMap seedDB, File seedDBFile) {