From 931541d198baf043ac2fc49f083e162ef9084d94 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Thu, 6 Feb 2014 22:39:19 +0100 Subject: [PATCH] re-inserted default value re-set button to performance queues and patched missing values for recent new queues --- defaults/yacy.init | 10 ++++- htroot/PerformanceQueues_p.html | 1 + htroot/PerformanceQueues_p.java | 27 +++++------- source/net/yacy/search/Switchboard.java | 58 ++++++++++++------------- 4 files changed, 49 insertions(+), 47 deletions(-) diff --git a/defaults/yacy.init b/defaults/yacy.init index b3804ef7d..8dc36d1f2 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -605,7 +605,7 @@ collection=user 30_peerping_idlesleep=30000 30_peerping_busysleep=30000 30_peerping_memprereq=2097152 -30_peerping_loadprereq=2.0 +30_peerping_loadprereq=4.0 40_peerseedcycle_idlesleep=1800000 40_peerseedcycle_busysleep=1200000 40_peerseedcycle_memprereq=4194304 @@ -629,6 +629,14 @@ collection=user 70_surrogates_busysleep=0 70_surrogates_memprereq=12582912 70_surrogates_loadprereq=8.0 +720_ccimport_idlesleep=100 +720_ccimport_busysleep=1000 +720_ccimport_memprereq=1048576 +720_ccimport_loadprereq=9.0 +730_ccfilter_idlesleep=100 +730_ccfilter_busysleep=1000 +730_ccfilter_memprereq=1048576 +730_ccfilter_loadprereq=9.0 80_searchresult_idlesleep=10000 80_searchresult_busysleep=200 80_searchresult_memprereq=0 diff --git a/htroot/PerformanceQueues_p.html b/htroot/PerformanceQueues_p.html index 6cf5ce64d..d3c73f52c 100644 --- a/htroot/PerformanceQueues_p.html +++ b/htroot/PerformanceQueues_p.html @@ -59,6 +59,7 @@ + Changes take effect immediately
diff --git a/htroot/PerformanceQueues_p.java b/htroot/PerformanceQueues_p.java index 9de319a04..a1741ba7e 100644 --- a/htroot/PerformanceQueues_p.java +++ b/htroot/PerformanceQueues_p.java @@ -125,7 +125,6 @@ public class PerformanceQueues_p { int c = 0; long idleCycles, busyCycles, memshortageCycles; // set profile? - final double multiplier = (post != null) && post.containsKey("profileSpeed") ? 100.0 / post.getFloat("profileSpeed", 100.0f) : 1.0; final boolean setProfile = (post != null && post.containsKey("submitdefault")); final boolean setDelay = (post != null) && (post.containsKey("submitdelay")); // save used settings file to config @@ -197,22 +196,16 @@ public class PerformanceQueues_p { busysleep = sb.getConfigLong(threadName + "_busysleep", busysleep); } if (setProfile) { - if (threadName.equals(SwitchboardConstants.PEER_PING) || - threadName.equals(SwitchboardConstants.SEED_UPLOAD) || - threadName.equals(SwitchboardConstants.CLEANUP)) { - /* do not change any values */ - } else { - // load with new values - idlesleep = (long) (Long.parseLong(d(defaultSettings.get(threadName + "_idlesleep"), String.valueOf(idlesleep))) * multiplier); - busysleep = (long) (Long.parseLong(d(defaultSettings.get(threadName + "_busysleep"), String.valueOf(busysleep))) * multiplier); - //memprereq = (long) (Long.parseLong(d(defaultSettings.get(threadName + "_memprereq"), String.valueOf(memprereq))) * multiplier); - - // check values to prevent short-cut loops - if (idlesleep < 1000) idlesleep = 1000; - if (threadName.equals("10_httpd")) { idlesleep = 0; busysleep = 0; memprereq = 0; loadprereq = 9; } - //if (threadName.equals(plasmaSwitchboardConstants.CRAWLJOB_LOCAL_CRAWL) && (busysleep < 50)) busysleep = 50; - sb.setThreadPerformance(threadName, idlesleep, busysleep, memprereq, loadprereq); - } + // load with new values + idlesleep = Long.parseLong(d(defaultSettings.get(threadName + "_idlesleep"), String.valueOf(idlesleep))); + busysleep = Long.parseLong(d(defaultSettings.get(threadName + "_busysleep"), String.valueOf(busysleep))); + memprereq = Long.parseLong(d(defaultSettings.get(threadName + "_memprereq"), String.valueOf(memprereq))); + loadprereq = Double.parseDouble(d(defaultSettings.get(threadName + "_loadprereq"), String.valueOf(memprereq))); + // check values to prevent short-cut loops + if (idlesleep < 1000) idlesleep = 1000; + if (threadName.equals("10_httpd")) { idlesleep = 0; busysleep = 0; memprereq = 0; loadprereq = 9; } + //if (threadName.equals(plasmaSwitchboardConstants.CRAWLJOB_LOCAL_CRAWL) && (busysleep < 50)) busysleep = 50; + sb.setThreadPerformance(threadName, idlesleep, busysleep, memprereq, loadprereq); } prop.put("table_" + c + "_idlesleep", idlesleep); prop.put("table_" + c + "_busysleep", busysleep); diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java index 8e8df2174..45292f4b6 100644 --- a/source/net/yacy/search/Switchboard.java +++ b/source/net/yacy/search/Switchboard.java @@ -1095,36 +1095,36 @@ public final class Switchboard extends serverSwitch { // content control: initialize list sync thread deployThread( - "720_ccimport", - "Content Control Import", - "this is the content control import thread", - null, - new InstantBusyThread( - new SMWListSyncThread(this, sb.getConfig("contentcontrol.bookmarklist", "contentcontrol"), "Category:Content Source", "/?Url/?Filter/?Category/?Modification date", sb.getConfigBool( - "contentcontrol.smwimport.purgelistoninit", false)), - "run", - SwitchboardConstants.PEER_PING_METHOD_JOBCOUNT, - SwitchboardConstants.PEER_PING_METHOD_FREEMEM, - 3000, - 10000, - 3000, - 10000), - 2000); + "720_ccimport", + "Content Control Import", + "this is the content control import thread", + null, + new InstantBusyThread( + new SMWListSyncThread(this, sb.getConfig("contentcontrol.bookmarklist", "contentcontrol"), "Category:Content Source", "/?Url/?Filter/?Category/?Modification date", sb.getConfigBool( + "contentcontrol.smwimport.purgelistoninit", false)), + "run", + SwitchboardConstants.PEER_PING_METHOD_JOBCOUNT, + SwitchboardConstants.PEER_PING_METHOD_FREEMEM, + 3000, + 10000, + 3000, + 10000), + 2000); deployThread( - "730_ccfilter", - "Content Control Filter", - "this is the content control filter update thread", - null, - new InstantBusyThread( - new ContentControlFilterUpdateThread(this), - "run", - SwitchboardConstants.PEER_PING_METHOD_JOBCOUNT, - SwitchboardConstants.PEER_PING_METHOD_FREEMEM, - 3000, - 10000, - 3000, - 10000), - 2000); + "730_ccfilter", + "Content Control Filter", + "this is the content control filter update thread", + null, + new InstantBusyThread( + new ContentControlFilterUpdateThread(this), + "run", + SwitchboardConstants.PEER_PING_METHOD_JOBCOUNT, + SwitchboardConstants.PEER_PING_METHOD_FREEMEM, + 3000, + 10000, + 3000, + 10000), + 2000); // set network-specific performance attributes if ( this.firstInit ) {