* Throttle: Reduce default max tunnels to 2000 (was 2500)
This commit is contained in:
@ -31,7 +31,7 @@ class RouterThrottleImpl implements RouterThrottle {
|
|||||||
private static int THROTTLE_EVENT_LIMIT = 30;
|
private static int THROTTLE_EVENT_LIMIT = 30;
|
||||||
|
|
||||||
private static final String PROP_MAX_TUNNELS = "router.maxParticipatingTunnels";
|
private static final String PROP_MAX_TUNNELS = "router.maxParticipatingTunnels";
|
||||||
private static final String DEFAULT_MAX_TUNNELS = "2500"; // Unless share BW > 250KBps, BW limit will kick in first
|
private static final int DEFAULT_MAX_TUNNELS = 2000;
|
||||||
private static final String PROP_DEFAULT_KBPS_THROTTLE = "router.defaultKBpsThrottle";
|
private static final String PROP_DEFAULT_KBPS_THROTTLE = "router.defaultKBpsThrottle";
|
||||||
|
|
||||||
/** tunnel acceptance */
|
/** tunnel acceptance */
|
||||||
@ -190,10 +190,14 @@ class RouterThrottleImpl implements RouterThrottle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String maxTunnels = _context.getProperty(PROP_MAX_TUNNELS, DEFAULT_MAX_TUNNELS);
|
int max = DEFAULT_MAX_TUNNELS;
|
||||||
|
String maxTunnels = _context.getProperty(PROP_MAX_TUNNELS);
|
||||||
if (maxTunnels != null) {
|
if (maxTunnels != null) {
|
||||||
try {
|
try {
|
||||||
int max = Integer.parseInt(maxTunnels);
|
max = Integer.parseInt(maxTunnels);
|
||||||
|
} catch (NumberFormatException nfe) {
|
||||||
|
}
|
||||||
|
}
|
||||||
if (numTunnels >= max) {
|
if (numTunnels >= max) {
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.WARN))
|
||||||
_log.warn("Refusing tunnel request since we are already participating in "
|
_log.warn("Refusing tunnel request since we are already participating in "
|
||||||
@ -202,9 +206,6 @@ class RouterThrottleImpl implements RouterThrottle {
|
|||||||
setTunnelStatus("Rejecting tunnels: Limit reached");
|
setTunnelStatus("Rejecting tunnels: Limit reached");
|
||||||
return TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
|
return TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException nfe) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ok, we're not hosed, but can we handle the bandwidth requirements
|
// ok, we're not hosed, but can we handle the bandwidth requirements
|
||||||
// of another tunnel?
|
// of another tunnel?
|
||||||
|
Reference in New Issue
Block a user