diff --git a/htroot/PerformanceQueues_p.java b/htroot/PerformanceQueues_p.java index 289bd3d5e..c6651b9ad 100644 --- a/htroot/PerformanceQueues_p.java +++ b/htroot/PerformanceQueues_p.java @@ -180,7 +180,6 @@ public class PerformanceQueues_p { // 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; } sb.setThreadPerformance(threadName, idlesleep, busysleep, memprereq, loadprereq); idlesleep = sb.getConfigLong(threadName + "_idlesleep", idlesleep); @@ -194,7 +193,6 @@ public class PerformanceQueues_p { 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); } @@ -204,7 +202,6 @@ public class PerformanceQueues_p { prop.put("table_" + c + "_loadprereq", loadprereq); // disallow setting of memprereq for indexer to prevent db from throwing OOMs // prop.put("table_" + c + "_disabled", /*(threadName.endsWith("_indexing")) ? 1 :*/ "0"); - prop.put("table_" + c + "_disabled", threadName.equals("10_httpd") ? "1" : "0" ); // httpd hardcoded defaults prop.put("table_" + c + "_recommendation", threadName.endsWith("_indexing") ? "1" : "0"); prop.putNum("table_" + c + "_recommendation_value", rwi == null ? 0 : threadName.endsWith("_indexing") ? (rwi.minMem() / 1024) : 0); c++; diff --git a/source/net/yacy/kelondro/workflow/AbstractBusyThread.java b/source/net/yacy/kelondro/workflow/AbstractBusyThread.java index a8e3477ef..de15a0d80 100644 --- a/source/net/yacy/kelondro/workflow/AbstractBusyThread.java +++ b/source/net/yacy/kelondro/workflow/AbstractBusyThread.java @@ -41,13 +41,23 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT private boolean intermissionObedient = true; private final Object syncObject = new Object(); - private long idleSleep = Long.MIN_VALUE; - private long busySleep = Long.MIN_VALUE; - - public AbstractBusyThread(long idleSleep, long busySleep) { + private final long idleSleep; // min allowed idle sleep + private final long busySleep; // min allowed busy sleep + + /** + * Initializes the AbstractBusyThread with min allowed sleep time (in milliseconds) + * and sets the actual sleep time to this values. + * + * @param minidleSleep defines min idle sleep time that can be set via setIdleSleep() + * @param minbusySleep defines min busy sleep time that can be set via setBusySleep() + */ + public AbstractBusyThread(long minidleSleep, long minbusySleep) { super(); - this.idleSleep = idleSleep; - this.busySleep = busySleep; + this.idleSleep = minidleSleep; // set min allowed + this.busySleep = minbusySleep; + + this.idlePause = minidleSleep; // initialized actual (might be changed ba set methodes) + this.busyPause = minbusySleep; // init here makes sure getIdleSleep() returns at least min allowed } @Override @@ -55,7 +65,14 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT // sets a sleep time before execution of the job-loop startup = milliseconds; } - + + /** + * Set the delay between idle cycles to the larger of the input argument + * and the min allowed delay defined on init + * + * @param milliseconds + * @return the actually set sleep time + */ @Override public final long setIdleSleep(final long milliseconds) { // sets a sleep time for pauses between two jobs @@ -67,7 +84,14 @@ public abstract class AbstractBusyThread extends AbstractThread implements BusyT public final long getIdleSleep() { return idlePause; } - + + /** + * Set the delay between busy cycles to the larger of the input argument + * and the min allowed delay defined on init + * + * @param milliseconds + * @return the actually set sleep time + */ @Override public final long setBusySleep(final long milliseconds) { // sets a sleep time for pauses between two jobs