Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

* save performance profile speed * fix for wrong javastart_priority after first start

lotuse5c0b969d622
diff --git a/defaults/yacy.init b/defaults/yacy.init
index d16f90924..8fa709869 100644
--- a/defaults/yacy.init
+++ b/defaults/yacy.init
@@ -543,6 +543,7 @@ filterOutStopwordsFromTopwords=true
# be available/free in the heap; othervise the loop is not executed
# and another idlesleep is performed
performanceProfile=defaults/yacy.init
+performanceSpeed=100
20_dhtdistribution_idlesleep=30000
20_dhtdistribution_busysleep=10000
20_dhtdistribution_memprereq=6291456
@@ -602,7 +603,6 @@ javastart_Xms=Xms120m
# UNIX: corresponds to the nice-level
# WIN: -20=realtime;-15=high;-10=above;0=normal;10=below;20=low
javastart_priority=10
-javastart_priority__pro=0
# performance properties for the word index cache
# wordCacheMaxLow/High is the number of word indexes that shall be held in the
diff --git a/htroot/PerformanceQueues_p.html b/htroot/PerformanceQueues_p.html
index dbeb09fce..9f3748844 100644
--- a/htroot/PerformanceQueues_p.html
+++ b/htroot/PerformanceQueues_p.html
@@ -17,7 +17,14 @@
#{profile}#
<option value="#[filename]#"#(used)#:: selected="selected"#(/used)#>#[description]#</option>
#{/profile}#
- </select> and use <select name="multiplier"><option value="0.5">200 %</option><option value="0.75">150 %</option><option value="1" selected="selected">100 %</option><option value="2">50 %</option><option value="3">33 %</option><option value="10">10 %</option></select> of the defiend performance.
+ </select>
+ and use
+ <select name="profileSpeed">
+ #{speed}#
+ <option value="#[value]#"#(used)#:: selected="selected"#(/used)#>#[label]#</option>
+ #{/speed}#
+ </select>
+ of the defiend performance.
</p>
<p><input type="submit" name="submitdefault" value="Save" /> Changes take effect immediately</p>
</fieldset>
diff --git a/htroot/PerformanceQueues_p.java b/htroot/PerformanceQueues_p.java
index 1452228c5..1c5065826 100644
--- a/htroot/PerformanceQueues_p.java
+++ b/htroot/PerformanceQueues_p.java
@@ -93,11 +93,14 @@ public class PerformanceQueues_p {
int c = 0;
long idleCycles, busyCycles, memshortageCycles;
// set profile?
- final double multiplier = (post != null) && post.containsKey("multiplier") ? post.getDouble("multiplier", 1) : 1;
+ final double multiplier = (post != null) && post.containsKey("profileSpeed") ? 100.0 / post.getDouble("profileSpeed", 100.0) : 1.0;
final boolean setProfile = (post != null && post.containsKey("submitdefault"));
final boolean setDelay = (post != null) && (post.containsKey("submitdelay"));
// save used settings file to config
- if (setProfile && post != null) switchboard.setConfig("performanceProfile", post.get("defaultFile", "defaults/yacy.init"));
+ if (setProfile && post != null){
+ switchboard.setConfig("performanceProfile", post.get("defaultFile", "defaults/yacy.init"));
+ switchboard.setConfig("performanceSpeed", post.getInt("profileSpeed", 100));
+ }
while (threads.hasNext()) {
threadName = threads.next();
@@ -191,6 +194,17 @@ public class PerformanceQueues_p {
}
prop.put("profile", c);
+ c = 0;
+ final int[] speedValues = {200,150,100,50,25,10};
+ final int usedspeed = Integer.parseInt(switchboard.getConfig("performanceSpeed", "100"));
+ for(final int speed: speedValues){
+ prop.put("speed_" + c + "_value", speed);
+ prop.put("speed_" + c + "_label", speed + " %");
+ prop.put("speed_" + c + "_used", (speed == usedspeed) ? "1" : "0");
+ c++;
+ }
+ prop.put("speed", c);
+
if ((post != null) && (post.containsKey("cacheSizeSubmit"))) {
final int wordCacheMaxCount = post.getInt("wordCacheMaxCount", 20000);
switchboard.setConfig(plasmaSwitchboardConstants.WORDCACHE_MAX_COUNT, Integer.toString(wordCacheMaxCount));