From 71a31f09026d885c76b9906ef6c293946d4777ed Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 20 Sep 2005 10:54:20 +0000 Subject: [PATCH] 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 --- htroot/PerformanceMemory_p.html | 33 +++++++++++++++---- htroot/PerformanceMemory_p.java | 11 ++++++- htroot/PerformanceQueues_p.html | 4 ++- .../env/templates/submenuPerformance.template | 11 +++++++ source/de/anomic/plasma/plasmaHTCache.java | 4 +++ source/de/anomic/yacy/yacySeedDB.java | 5 +-- 6 files changed, 57 insertions(+), 11 deletions(-) create mode 100644 htroot/env/templates/submenuPerformance.template diff --git a/htroot/PerformanceMemory_p.html b/htroot/PerformanceMemory_p.html index 78fd2aac6..2d6b81d78 100644 --- a/htroot/PerformanceMemory_p.html +++ b/htroot/PerformanceMemory_p.html @@ -6,21 +6,40 @@ #[header]# -

+#[submenuPerformance]# +

Performance Settings for Memory

+ +

+

Available Memory:
+ + + + + + + + + + + + +
After StartupAfter InitializationsNow
#[memoryFreeAfterStartup]# bytes#[memoryFreeAfterInit]# bytes#[memoryFreeNow]# bytes
+

+

RAM Cache for Database Files:
- - - - - - + + + + + + diff --git a/htroot/PerformanceMemory_p.java b/htroot/PerformanceMemory_p.java index 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.html index a28e2a689..3de7f221f 100644 --- a/htroot/PerformanceQueues_p.html +++ b/htroot/PerformanceQueues_p.html @@ -6,8 +6,10 @@ #[header]# -

+#[submenuPerformance]# +

Performance Settings of Queues and Processes

+

Scheduled tasks overview and waiting time settings:
Database
Chunk Size
(bytes)
#Needed Slots
(= DB Size)
#Empty Slots
 
#Used Slots
High Priority
#Used Slots
Medium Priority
#Used Slots
Low Priority
Chunk Size
(bytes)
#Needed Slots
(= DB Size)
#Empty Slots
 
#Used Slots
High Priority
#Used Slots
Medium Priority
#Used Slots
Low Priority
Used
Size
Assigned
Max-Size
Recommended
Max-Size
diff --git a/htroot/env/templates/submenuPerformance.template b/htroot/env/templates/submenuPerformance.template new file mode 100644 index 000000000..94f8032f8 --- /dev/null +++ b/htroot/env/templates/submenuPerformance.template @@ -0,0 +1,11 @@ +
+ + + + + + + + \ No newline at end of file diff --git a/source/de/anomic/plasma/plasmaHTCache.java b/source/de/anomic/plasma/plasmaHTCache.java index 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.java index 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 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) {