added the property timeoutrequests to configuration to disable

TimeoutRequests. The purpose is to test if YaCy runs better on VMs where
there is a limitation of concurrent processes;  see
/proc/user_beancounters in row numproc; this value is limited and should
be low. Try to set timeoutrequests to keep this low. (works only after
restart)
pull/1/head
Michael Peter Christen 10 years ago
parent 97f6089a41
commit 60f27bdf49

@ -1266,6 +1266,9 @@ crawler.userAgent.string = yacybot ($$SYSTEM$$) http://yacy.net/bot.html
crawler.userAgent.minimumdelta = 500
crawler.userAgent.clienttimeout = 10000
# experiments with timeout requests
timeoutrequests = true
# interface decorations
decoration.audio = false
decoration.grafics.linkstructure = true

@ -52,6 +52,8 @@ import jcifs.smb.SmbFile;
*/
public class TimeoutRequest<E> {
public static boolean enable = true; // for tests
private final Callable<E> call;
/**
@ -68,6 +70,12 @@ public class TimeoutRequest<E> {
* @throws ExecutionException
*/
public E call(final long timeout) throws ExecutionException {
if (!enable) {try {
return this.call.call();
} catch (final Exception e1) {
throw new ExecutionException(e1);
}
}
final ExecutorService service = Executors.newSingleThreadExecutor();
try {
final Future<E> taskFuture = service.submit(this.call);

@ -314,6 +314,10 @@ public final class Switchboard extends serverSwitch {
// set default peer name
Seed.ANON_PREFIX = getConfig("peernameprefix", "_anon");
// set timeoutrequests
boolean timeoutrequests = getConfigBool("timeoutrequests", true);
TimeoutRequest.enable = timeoutrequests;
// UPnP port mapping
if ( getConfigBool(SwitchboardConstants.UPNP_ENABLED, false) ) {
InstantBusyThread.oneTimeJob(UPnP.class, "addPortMappings", 0);

Loading…
Cancel
Save