diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java
index a3de9cc47..3d6961f08 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java
@@ -213,11 +213,11 @@ public class SummaryHelper {
}
/**
- * How fast we have been receiving data over the last minute (pretty printed
+ * How fast we have been receiving data over the last second (pretty printed
* string with 2 decimal places representing the KBps)
*
*/
- public String getInboundMinuteKBps() {
+ public String getInboundSecondKBps() {
if (_context == null)
return "0.0";
double kbps = _context.bandwidthLimiter().getReceiveBps()/1024d;
@@ -225,11 +225,11 @@ public class SummaryHelper {
return fmt.format(kbps);
}
/**
- * How fast we have been sending data over the last minute (pretty printed
+ * How fast we have been sending data over the last second (pretty printed
* string with 2 decimal places representing the KBps)
*
*/
- public String getOutboundMinuteKBps() {
+ public String getOutboundSecondKBps() {
if (_context == null)
return "0.0";
double kbps = _context.bandwidthLimiter().getSendBps()/1024d;
diff --git a/apps/routerconsole/jsp/summary.jsp b/apps/routerconsole/jsp/summary.jsp
index 38a4d0fc8..180b2a7b8 100644
--- a/apps/routerconsole/jsp/summary.jsp
+++ b/apps/routerconsole/jsp/summary.jsp
@@ -65,7 +65,7 @@
%>
Bandwidth in/out
- 1s: /KBps
+ 1s: /KBps
5m: /KBps
Total: /KBps
Used: /
diff --git a/history.txt b/history.txt
index 0b6f659fc..5e77c3727 100644
--- a/history.txt
+++ b/history.txt
@@ -1,4 +1,13 @@
-$Id: history.txt,v 1.465 2006/05/01 14:09:02 jrandom Exp $
+$Id: history.txt,v 1.466 2006/05/01 17:42:24 jrandom Exp $
+
+2006-05-02 Complication
+ * Correct a misnamed property in SummaryHelper.java
+ to avoid confusion
+ * Make the maximum allowance of our own concurrent
+ tunnel builds slightly adaptive: one concurrent build per 6 KB/s
+ within the fixed range 2..10
+ * While overloaded, try to avoid completely choking our own build attempts,
+ instead prefer limiting them to 1
2006-05-01 jrandom
* Adjust the tunnel build timeouts to cut down on expirations, and
diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java
index 45abfd2c8..735e6943f 100644
--- a/router/java/src/net/i2p/router/RouterVersion.java
+++ b/router/java/src/net/i2p/router/RouterVersion.java
@@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
- public final static String ID = "$Revision: 1.405 $ $Date: 2006/05/01 14:09:02 $";
+ public final static String ID = "$Revision: 1.406 $ $Date: 2006/05/01 17:40:23 $";
public final static String VERSION = "0.6.1.17";
- public final static long BUILD = 4;
+ public final static long BUILD = 5;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);
diff --git a/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java b/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java
index cfe7aab61..7abea6409 100644
--- a/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java
+++ b/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java
@@ -52,7 +52,12 @@ class BuildExecutor implements Runnable {
buf = new StringBuffer(128);
buf.append("Allowed: ");
}
- int allowed = 5;
+
+ int maxKBps = _context.bandwidthLimiter().getOutboundKBytesPerSecond();
+ int allowed = maxKBps / 6; // Max. 1 concurrent build per 6 KB/s outbound
+ if (allowed < 2) allowed = 2; // Never choke below 2 builds (but congestion may)
+ if (allowed > 10) allowed = 10; // Never go beyond 10, that is uncharted territory (old limit was 5)
+
String prop = _context.getProperty("router.tunnelConcurrentBuilds");
if (prop != null)
try { allowed = Integer.valueOf(prop).intValue(); } catch (NumberFormatException nfe) {}
@@ -107,11 +112,14 @@ class BuildExecutor implements Runnable {
if (_log.shouldLog(Log.WARN))
_log.warn("Too lagged [" + lag + "], don't allow building");
_context.statManager().addRateData("tunnel.concurrentBuildsLagged", concurrent, lag);
- return 0; // if we have a job heavily blocking our jobqueue, ssllloowww dddooowwwnnn
+ _log.error("Allowed was " + allowed + ", but we had lag issues, so ended up allowing " + Math.min(allowed,1));
+ return Math.min(allowed,1); // if we have a job heavily blocking our jobqueue, ssllloowww dddooowwwnnn
}
- if (isOverloaded())
- return 0;
+ if (isOverloaded()) {
+ _log.error("Allowed was " + allowed + ", but we were overloaded, so ended up allowing " + Math.min(allowed,1));
+ return Math.min(allowed,1);
+ }
return allowed;
}
@@ -124,7 +132,7 @@ class BuildExecutor implements Runnable {
// dont include the inbound rates when throttling tunnel building, since
// that'd expose a pretty trivial attack.
int maxKBps = _context.bandwidthLimiter().getOutboundKBytesPerSecond();
- int used1s = _context.router().get1sRate(true); // dont throttle on the 1s rate, its too volatile
+ int used1s = 0; // dont throttle on the 1s rate, its too volatile
int used1m = _context.router().get1mRate(true);
int used5m = 0; //get5mRate(_context); // don't throttle on the 5m rate, as that'd hide available bandwidth
int used = Math.max(Math.max(used1s, used1m), used5m);