make responder cache size configurable

This commit is contained in:
Zlatin Balevsky
2020-09-22 12:17:27 +01:00
parent 84d61fccd5
commit cbaa3470d2
2 changed files with 9 additions and 1 deletions

View File

@ -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)

View File

@ -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))