I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit a3a4888e authored by jrandom's avatar jrandom Committed by zzz
Browse files

2006-06-08 jrandom

    * Be more conservative in the proactive rejections
parent 6fd7881f
No related branches found
No related tags found
No related merge requests found
$Id: history.txt,v 1.481 2006-06-04 17:25:08 jrandom Exp $
$Id: history.txt,v 1.482 2006-06-04 20:33:03 complication Exp $
2006-06-08 jrandom
* Be more conservative in the proactive rejections
2006-06-04 Complication
* Trim out sending a blank line before USER in susimail.
......
......@@ -151,8 +151,8 @@ class RouterThrottleImpl implements RouterThrottle {
else
avg10m = tunnelTestTime10m.getLifetimeAverageValue();
if (avg10m < 2000)
avg10m = 2000; // minimum before complaining
if (avg10m < 5000)
avg10m = 5000; // minimum before complaining
if ( (avg10m > 0) && (avg1m > avg10m * tunnelTestTimeGrowthFactor) ) {
double probAccept = (avg10m*tunnelTestTimeGrowthFactor)/avg1m;
......@@ -163,7 +163,7 @@ class RouterThrottleImpl implements RouterThrottle {
if (_log.shouldLog(Log.INFO))
_log.info("Probabalistically accept tunnel request (p=" + probAccept
+ " v=" + v + " test time avg 1m=" + avg1m + " 10m=" + avg10m + ")");
} else {
} else if (false) {
if (_log.shouldLog(Log.WARN))
_log.warn("Probabalistically refusing tunnel request (test time avg 1m=" + avg1m
+ " 10m=" + avg10m + ")");
......@@ -228,7 +228,7 @@ class RouterThrottleImpl implements RouterThrottle {
timePerRequest = (int)rs.getLifetimeAverageValue();
}
float pctFull = (queuedRequests * timePerRequest) / (10*1000f);
float pReject = 1 - ((1-pctFull) * (1-pctFull));
float pReject = pctFull * pctFull; //1 - ((1-pctFull) * (1-pctFull));
if ( (pctFull >= 1) || (pReject >= _context.random().nextFloat()) ) {
if (_log.shouldLog(Log.WARN))
_log.warn("Rejecting a new tunnel request because we have too many pending requests (" + queuedRequests
......@@ -269,7 +269,10 @@ class RouterThrottleImpl implements RouterThrottle {
_context.statManager().addRateData("router.throttleTunnelBytesUsed", used, maxKBps);
_context.statManager().addRateData("router.throttleTunnelBytesAllowed", availBps, (long)bytesAllocated);
if (used1m > (maxKBps*1024)) {
long overage = used1m - (maxKBps*1024);
if ( (overage > 0) &&
((overage/(float)(maxKBps*1024f)) > _context.random().nextFloat()) ) {
if (_log.shouldLog(Log.WARN)) _log.warn("Reject tunnel, 1m rate (" + used1m + ") indicates overload.");
return false;
}
......@@ -342,9 +345,9 @@ class RouterThrottleImpl implements RouterThrottle {
/** dont ever probabalistically throttle tunnels if we have less than this many */
private int getMinThrottleTunnels() {
try {
return Integer.parseInt(_context.getProperty("router.minThrottleTunnels", "40"));
return Integer.parseInt(_context.getProperty("router.minThrottleTunnels", "1000"));
} catch (NumberFormatException nfe) {
return 40;
return 1000;
}
}
......
......@@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.421 $ $Date: 2006-06-04 17:25:20 $";
public final static String ID = "$Revision: 1.422 $ $Date: 2006-06-04 20:33:04 $";
public final static String VERSION = "0.6.1.20";
public final static long BUILD = 1;
public final static long BUILD = 2;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment