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
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;
deployThread("90_cleanup", "Cleanup", "simple cleaning process for monitoring information" ,
new serverInstantThread(this, "cleanupJob", "cleanupJobSize"), 10000); // all 5 Minutes
@ -468,7 +468,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
public int totalSize() {
return processStack.size() + cacheLoader.size() + noticeURL.stackSize();
}
*/
*/
public int queueSize() {
return queueStack.size();
@ -491,22 +491,26 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
public boolean deQueue() {
// work off fresh entries from the proxy or from the crawler
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) {}
// do one processing step
log.logDebug("DEQUEUE: cacheManager=" + ((cacheManager.idle()) ? "idle" : "busy") +
", queueStack=" + queueStack.size() +
", coreStackSize=" + noticeURL.coreStackSize() +
", limitStackSize=" + noticeURL.limitStackSize() +
", overhangStackSize=" + noticeURL.overhangStackSize() +
", remoteStackSize=" + noticeURL.remoteStackSize());
processResourceStack((plasmaHTCache.Entry) queueStack.removeFirst());
plasmaHTCache.Entry nextentry;
synchronized (queueStack) {
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) {}
// do one processing step
log.logDebug("DEQUEUE: cacheManager=" + ((cacheManager.idle()) ? "idle" : "busy") +
", queueStack=" + queueStack.size() +
", coreStackSize=" + noticeURL.coreStackSize() +
", limitStackSize=" + noticeURL.limitStackSize() +
", overhangStackSize=" + noticeURL.overhangStackSize() +
", remoteStackSize=" + noticeURL.remoteStackSize());
nextentry = (plasmaHTCache.Entry) queueStack.removeFirst();
}
processResourceStack(nextentry);
return true;
}

@ -195,7 +195,7 @@ public abstract class serverAbstractThread extends Thread implements serverThrea
// do job
timestamp = System.currentTimeMillis();
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
if ((this.idlePause < 0) || (this.busyPause < 0)) break; // for one-time jobs
// process scheduled pause

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

Loading…
Cancel
Save