2005-02-26 jrandom

* Further streaming lib caching improvements
    * Reduce the minimum RTT (used to calculate retry timeouts), but also
      increase the RTT on resends.
    * Lower the default message size to 4KB from 16KB to further reduce the
      chance of failed fragmentation.
    * Extend tunnel rebuild throttling to include fallback rebuilds
    * If there are less than 20 routers known, don't drop the last 20 (to help
      avoid dropping all peers under catastrophic failures)
    * New stats for end to end messages - "client.leaseSetFoundLocally",
      "client.leaseSetFoundRemoteTime", and "client.leaseSetFailedRemoteTime"
This commit is contained in:
jrandom
2005-02-26 19:16:46 +00:00
committed by zzz
parent 4cec9da0a6
commit 238389fc7f
15 changed files with 84 additions and 39 deletions

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.151 $ $Date: 2005/02/24 13:05:26 $";
public final static String ID = "$Revision: 1.152 $ $Date: 2005/02/24 18:53:36 $";
public final static String VERSION = "0.5.0.1";
public final static long BUILD = 3;
public final static long BUILD = 4;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -62,6 +62,7 @@ public class OutboundClientMessageOneShotJob extends JobImpl {
private long _cloveId;
private long _start;
private boolean _finished;
private long _leaseSetLookupBegin;
/**
* final timeout (in milliseconds) that the outbound message will fail in.
@ -110,13 +111,16 @@ public class OutboundClientMessageOneShotJob extends JobImpl {
ctx.statManager().createRateStat("client.timeoutCongestionTunnel", "How lagged our tunnels are when a send times out?", "ClientMessages", new long[] { 5*60*1000l, 60*60*1000l, 24*60*60*1000l });
ctx.statManager().createRateStat("client.timeoutCongestionMessage", "How fast we process messages locally when a send times out?", "ClientMessages", new long[] { 5*60*1000l, 60*60*1000l, 24*60*60*1000l });
ctx.statManager().createRateStat("client.timeoutCongestionInbound", "How much faster we are receiving data than our average bps when a send times out?", "ClientMessages", new long[] { 5*60*1000l, 60*60*1000l, 24*60*60*1000l });
ctx.statManager().createRateStat("client.leaseSetFoundLocally", "How often we tried to look for a leaseSet and found it locally?", "ClientMessages", new long[] { 5*60*1000l, 60*60*1000l, 24*60*60*1000l });
ctx.statManager().createRateStat("client.leaseSetFoundRemoteTime", "How long we tried to look fora remote leaseSet (when we succeeded)?", "ClientMessages", new long[] { 5*60*1000l, 60*60*1000l, 24*60*60*1000l });
ctx.statManager().createRateStat("client.leaseSetFailedRemoteTime", "How long we tried to look for a remote leaseSet (when we failed)?", "ClientMessages", new long[] { 5*60*1000l, 60*60*1000l, 24*60*60*1000l });
long timeoutMs = OVERALL_TIMEOUT_MS_DEFAULT;
_clientMessage = msg;
_clientMessageId = msg.getMessageId();
_clientMessageSize = msg.getPayload().getSize();
_from = msg.getFromDestination();
_to = msg.getDestination();
_leaseSetLookupBegin = -1;
String param = msg.getSenderConfig().getOptions().getProperty(OVERALL_TIMEOUT_MS_PARAM);
if (param == null)
@ -154,9 +158,15 @@ public class OutboundClientMessageOneShotJob extends JobImpl {
LookupLeaseSetFailedJob failed = new LookupLeaseSetFailedJob(getContext());
if (_log.shouldLog(Log.DEBUG))
_log.debug(getJobId() + ": Send outbound client message - sending off leaseSet lookup job");
getContext().netDb().lookupLeaseSet(key, success, failed, timeoutMs);
if (_log.shouldLog(Log.DEBUG))
_log.debug(getJobId() + ": after sending off leaseSet lookup job");
LeaseSet ls = getContext().netDb().lookupLeaseSetLocally(key);
if (ls != null) {
getContext().statManager().addRateData("client.leaseSetFoundLocally", 1, 0);
_leaseSetLookupBegin = -1;
success.runJob();
} else {
_leaseSetLookupBegin = getContext().clock().now();
getContext().netDb().lookupLeaseSet(key, success, failed, timeoutMs);
}
}
private boolean getShouldBundle() {
@ -189,6 +199,10 @@ public class OutboundClientMessageOneShotJob extends JobImpl {
}
public String getName() { return "Send outbound client message through the lease"; }
public void runJob() {
if (_leaseSetLookupBegin > 0) {
long lookupTime = getContext().clock().now() - _leaseSetLookupBegin;
getContext().statManager().addRateData("client.leaseSetFoundRemoteTime", lookupTime, lookupTime);
}
boolean ok = getNextLease();
if (ok)
send();
@ -262,7 +276,12 @@ public class OutboundClientMessageOneShotJob extends JobImpl {
super(enclosingContext);
}
public String getName() { return "Lookup for outbound client message failed"; }
public void runJob() {
public void runJob() {
if (_leaseSetLookupBegin > 0) {
long lookupTime = getContext().clock().now() - _leaseSetLookupBegin;
getContext().statManager().addRateData("client.leaseSetFailedRemoteTime", lookupTime, lookupTime);
}
dieFatal();
}
}

View File

@ -115,8 +115,8 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
public final static String PROP_DB_DIR = "router.networkDatabase.dbDir";
public final static String DEFAULT_DB_DIR = "netDb";
/** if we have less than 5 routers left, don't drop any more, even if they're failing or doing bad shit */
private final static int MIN_REMAINING_ROUTERS = 5;
/** if we have less than 20 routers left, don't drop any more, even if they're failing or doing bad shit */
private final static int MIN_REMAINING_ROUTERS = 20;
/**
* dont accept any dbDtore of a router over 6 hours old (unless we dont

View File

@ -37,9 +37,6 @@ public class TunnelBuilder {
PooledTunnelCreatorConfig cfg = configTunnel(ctx, pool, zeroHop);
if (cfg == null) {
RetryJob j = new RetryJob(ctx, pool);
j.getTiming().setStartAfter(ctx.clock().now() + ctx.random().nextInt(30*1000));
ctx.jobQueue().addJob(j);
return;
}
OnCreatedJob onCreated = new OnCreatedJob(ctx, pool, cfg);

View File

@ -338,8 +338,8 @@ public class TunnelPool {
_log.info(toString() + ": building a fallback tunnel (usable: " + usable + " needed: " + quantity + ")");
if ( (usable == 0) && (_settings.getAllowZeroHop()) )
_builder.buildTunnel(_context, this, true);
else
_builder.buildTunnel(_context, this);
//else
// _builder.buildTunnel(_context, this);
refreshBuilders();
}
@ -433,7 +433,7 @@ public class TunnelPool {
if (!_alive) return;
int added = refreshBuilders();
if ( (added > 0) && (_log.shouldLog(Log.WARN)) )
_log.warn("Passive rebuilding a tunnel");
_log.warn("Passive rebuilding a tunnel for " + TunnelPool.this.toString());
requeue(60*1000);
}
}