integrated and extended new memory performance menu; found and fixed bug in DHT caching

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@752 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 20 years ago
parent fb52a82008
commit 71a31f0902

@ -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&nbsp;Size<br>(bytes)</td>
<td class="small">#Needed&nbsp;Slots<br>(=&nbsp;DB&nbsp;Size)</td>
<td class="small">#Empty&nbsp;Slots<br>&nbsp;</td>
<td class="small">#Used&nbsp;Slots<br>High&nbsp;Priority</td>
<td class="small">#Used&nbsp;Slots<br>Medium&nbsp;Priority</td>
<td class="small">#Used&nbsp;Slots<br>Low&nbsp;Priority</td>
<td class="small">Chunk Size<br>(bytes)</td>
<td class="small">#Needed Slots<br>(=&nbsp;DB&nbsp;Size)</td>
<td class="small">#Empty Slots<br>&nbsp;</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>

@ -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");

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

@ -0,0 +1,11 @@
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="SubMenu">
<tr height="10"><td colspan="17" class="MenuHeader">&nbsp;Performance Menu</td></tr>
<tr height="2"><td colspan="17"></td></tr>
<tr class="TableHeader">
<td width="50%" class="MenuSubItem">&nbsp;<img border="0" src="/env/grafics/lock.gif" align="top">&nbsp;
<a href="/PerformanceQueues_p.html" class="MenuItemLink">Queues Performance Settings</a>&nbsp;</td>
<td class="MenuSubSpacer"></td>
<td width="50%" class="MenuSubItem">&nbsp;<img border="0" src="/env/grafics/lock.gif" align="top">&nbsp;
<a href="/PerformanceMemory_p.html" class="MenuItemLink">Memory Settings for Database Caches</a>&nbsp;</td>
</tr>
</table>

@ -135,6 +135,10 @@ public final class plasmaHTCache {
}
}
public int dbSize() {
return responseHeaderDB.size();
}
public int dbCacheChunkSize() {
return responseHeaderDB.cacheChunkSize();
}

@ -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 database
if (seedDBFile.exists()) seedDBFile.delete();
@ -171,7 +172,7 @@ public final class yacySeedDB {
}
// create new seed database
new 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) {

Loading…
Cancel
Save