Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

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)

Michael Peter Christen60f27bdf49c5
diff --git a/defaults/yacy.init b/defaults/yacy.init
index 57247da79..3654a9e62 100644
--- a/defaults/yacy.init
+++ b/defaults/yacy.init
@@ -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
diff --git a/source/net/yacy/cora/protocol/TimeoutRequest.java b/source/net/yacy/cora/protocol/TimeoutRequest.java
index 21270a726..9f039233e 100644
--- a/source/net/yacy/cora/protocol/TimeoutRequest.java
+++ b/source/net/yacy/cora/protocol/TimeoutRequest.java
@@ -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);
diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java
index 74bd8293d..1caf73b09 100644
--- a/source/net/yacy/search/Switchboard.java
+++ b/source/net/yacy/search/Switchboard.java
@@ -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);