diff --git a/core/src/main/groovy/com/muwire/core/Core.groovy b/core/src/main/groovy/com/muwire/core/Core.groovy index 5032eea6..5a7830e1 100644 --- a/core/src/main/groovy/com/muwire/core/Core.groovy +++ b/core/src/main/groovy/com/muwire/core/Core.groovy @@ -309,7 +309,7 @@ public class Core { log.info("initializing responder cache") - ResponderCache responderCache = new ResponderCache((int)(Math.sqrt(props.peerConnections)) + 1) + ResponderCache responderCache = new ResponderCache(props.responderCacheSize) eventBus.register(UIResultBatchEvent.class, responderCache) diff --git a/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy b/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy index 913b8652..4677093f 100644 --- a/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy +++ b/core/src/main/groovy/com/muwire/core/MuWireSettings.groovy @@ -44,6 +44,8 @@ class MuWireSettings { int peerConnections int leafConnections + int responderCacheSize + boolean startChatServer int maxChatConnections boolean advertiseChat @@ -111,6 +113,9 @@ class MuWireSettings { leafConnections = Integer.valueOf(props.getProperty("leafConnections","512")) peerConnections = Integer.valueOf(props.getProperty("peerConnections","128")) + // responder cache settings + responderCacheSize = Integer.valueOf(props.getProperty("responderCacheSize","32")) + speedSmoothSeconds = Integer.valueOf(props.getProperty("speedSmoothSeconds","10")) totalUploadSlots = Integer.valueOf(props.getProperty("totalUploadSlots","-1")) uploadSlotsPerUser = Integer.valueOf(props.getProperty("uploadSlotsPerUser","-1")) @@ -182,6 +187,9 @@ class MuWireSettings { props.setProperty("peerConnections", String.valueOf(peerConnections)) props.setProperty("leafConnections", String.valueOf(leafConnections)) + // responder cache settings + props.setProperty("responderCacheSize", String.valueOf(responderCacheSize)) + props.setProperty("speedSmoothSeconds", String.valueOf(speedSmoothSeconds)) props.setProperty("totalUploadSlots", String.valueOf(totalUploadSlots)) props.setProperty("uploadSlotsPerUser", String.valueOf(uploadSlotsPerUser))