do not run dht ditribution if system load is over 2.5

pull/1/head
orbiter 12 years ago
parent 9c681cc00d
commit f50b596e0b

@ -837,6 +837,7 @@ indexControl.gzipBody = true
indexControl.timeout = 60000
indexDistribution.timeout = 60000
indexTransfer.timeout = 120000
indexTransfer.maxload = 2.5
# defining max. allowed amount of open files during index- transfer/distribution
indexDistribution.maxOpenFiles = 800

@ -3283,6 +3283,12 @@ public final class Switchboard extends serverSwitch {
+ ", sbQueue.size() = "
+ getIndexingProcessorsQueueSize();
}
double load = Memory.load();
float maxload = getConfigFloat(SwitchboardConstants.INDEX_TRANSFER_MAXLOAD, 1.5f);
if (load > maxload) {
return "no DHT distribution: system has too high load = " + load + ", maxload = " + maxload;
}
return null; // this means; yes, please do dht transfer
}

@ -254,6 +254,7 @@ public final class SwitchboardConstants {
public static final String INDEX_DIST_ALLOW_WHILE_CRAWLING = "allowDistributeIndexWhileCrawling";
public static final String INDEX_DIST_ALLOW_WHILE_INDEXING = "allowDistributeIndexWhileIndexing";
public static final String INDEX_TRANSFER_TIMEOUT = "indexTransfer.timeout";
public static final String INDEX_TRANSFER_MAXLOAD = "indexTransfer.maxload";
public static final String INDEX_TRANSFER_GZIP_BODY = "indexTransfer.gzipBody";
public static final String PARSER_MIME_DENY = "parser.mime.deny";
public static final String PARSER_EXTENSIONS_DENY = "parser.extensions.deny";

Loading…
Cancel
Save