git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@224 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 20 years ago
parent 83b41ef2f7
commit 4574fa4ce7

@ -334,7 +334,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
// deploy threads // deploy threads
log.logSystem("Starting Threads"); log.logSystem("Starting Threads");
int indexing_cluster = Integer.parseInt(getConfig("?80_indexing_cluster", "1")); int indexing_cluster = Integer.parseInt(getConfig("80_indexing_cluster", "1"));
if (indexing_cluster < 1) indexing_cluster = 1; if (indexing_cluster < 1) indexing_cluster = 1;
deployThread("90_cleanup", "Cleanup", "simple cleaning process for monitoring information" , deployThread("90_cleanup", "Cleanup", "simple cleaning process for monitoring information" ,
new serverInstantThread(this, "cleanupJob", "cleanupJobSize"), 10000); // all 5 Minutes new serverInstantThread(this, "cleanupJob", "cleanupJobSize"), 10000); // all 5 Minutes
@ -468,7 +468,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
public int totalSize() { public int totalSize() {
return processStack.size() + cacheLoader.size() + noticeURL.stackSize(); return processStack.size() + cacheLoader.size() + noticeURL.stackSize();
} }
*/ */
public int queueSize() { public int queueSize() {
return queueStack.size(); return queueStack.size();
@ -491,22 +491,26 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
public boolean deQueue() { public boolean deQueue() {
// work off fresh entries from the proxy or from the crawler // work off fresh entries from the proxy or from the crawler
if (queueStack.size() == 0) { plasmaHTCache.Entry nextentry;
//log.logDebug("DEQUEUE: queue is empty"); synchronized (queueStack) {
return false; // nothing to do if (queueStack.size() == 0) {
} //log.logDebug("DEQUEUE: queue is empty");
return false; // nothing to do
// in case that the server is very busy we do not work off the queue too fast }
if (!(cacheManager.idle())) try {Thread.currentThread().sleep(1000);} catch (InterruptedException e) {}
// in case that the server is very busy we do not work off the queue too fast
// do one processing step if (!(cacheManager.idle())) try {Thread.currentThread().sleep(1000);} catch (InterruptedException e) {}
log.logDebug("DEQUEUE: cacheManager=" + ((cacheManager.idle()) ? "idle" : "busy") +
", queueStack=" + queueStack.size() + // do one processing step
", coreStackSize=" + noticeURL.coreStackSize() + log.logDebug("DEQUEUE: cacheManager=" + ((cacheManager.idle()) ? "idle" : "busy") +
", limitStackSize=" + noticeURL.limitStackSize() + ", queueStack=" + queueStack.size() +
", overhangStackSize=" + noticeURL.overhangStackSize() + ", coreStackSize=" + noticeURL.coreStackSize() +
", remoteStackSize=" + noticeURL.remoteStackSize()); ", limitStackSize=" + noticeURL.limitStackSize() +
processResourceStack((plasmaHTCache.Entry) queueStack.removeFirst()); ", overhangStackSize=" + noticeURL.overhangStackSize() +
", remoteStackSize=" + noticeURL.remoteStackSize());
nextentry = (plasmaHTCache.Entry) queueStack.removeFirst();
}
processResourceStack(nextentry);
return true; return true;
} }

@ -195,7 +195,7 @@ public abstract class serverAbstractThread extends Thread implements serverThrea
// do job // do job
timestamp = System.currentTimeMillis(); timestamp = System.currentTimeMillis();
isBusy = this.job(); isBusy = this.job();
busytime += System.currentTimeMillis() - timestamp; busytime += (isBusy) ? System.currentTimeMillis() - timestamp : 0;
// interrupt loop if this is supposed to be a one-time job // interrupt loop if this is supposed to be a one-time job
if ((this.idlePause < 0) || (this.busyPause < 0)) break; // for one-time jobs if ((this.idlePause < 0) || (this.busyPause < 0)) break; // for one-time jobs
// process scheduled pause // process scheduled pause

@ -275,6 +275,7 @@ public final class yacy {
30000 /*command max length incl. GET args*/, 30000 /*command max length incl. GET args*/,
httpdLoglevel /*loglevel*/); httpdLoglevel /*loglevel*/);
server.setName("httpd:"+port); server.setName("httpd:"+port);
server.setPriority(Thread.MAX_PRIORITY);
if (server == null) { if (server == null) {
serverLog.logFailure("STARTUP", "Failed to start server. Probably port " + port + " already in use."); serverLog.logFailure("STARTUP", "Failed to start server. Probably port " + port + " already in use.");
} else { } else {

Loading…
Cancel
Save