* 2006-05-18 0.6.1.19 released

2006-05-18  jrandom
    * Made the SSU ACKs less frequent when possible
This commit is contained in:
jrandom
2006-05-18 22:31:06 +00:00
committed by zzz
parent de1ca4aea4
commit 85c2c11217
8 changed files with 31 additions and 16 deletions

View File

@@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.417 $ $Date: 2006-05-17 22:00:49 $";
public final static String VERSION = "0.6.1.18";
public final static long BUILD = 6;
public final static String ID = "$Revision: 1.418 $ $Date: 2006-05-17 22:42:57 $";
public final static String VERSION = "0.6.1.19";
public final static long BUILD = 0;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@@ -22,7 +22,7 @@ public class ACKSender implements Runnable {
private boolean _alive;
/** how frequently do we want to send ACKs to a peer? */
static final int ACK_FREQUENCY = 100;
static final int ACK_FREQUENCY = 200;
public ACKSender(RouterContext ctx, UDPTransport transport) {
_context = ctx;
@@ -60,6 +60,16 @@ public class ACKSender implements Runnable {
}
}
private long ackFrequency(long timeSinceACK, long rtt) {
// if we are actively pumping lots of data to them, we can depend upon
// the unsentACKThreshold to figure out when to send an ACK instead of
// using the timer, so we can set the timeout/frequency higher
if (timeSinceACK < 2*1000)
return Math.max(rtt/2, 500);
else
return ACK_FREQUENCY;
}
public void run() {
while (_alive) {
PeerState peer = null;
@@ -70,7 +80,7 @@ public class ACKSender implements Runnable {
for (int i = 0; i < _peersToACK.size(); i++) {
PeerState cur = (PeerState)_peersToACK.get(i);
long wanted = cur.getWantedACKSendSince();
long delta = wanted + ACK_FREQUENCY - now;
long delta = wanted + ackFrequency(now-cur.getLastACKSend(), cur.getRTT()) - now;
if ( ( (wanted > 0) && (delta < 0) ) || (cur.unsentACKThresholdReached()) ) {
_peersToACK.remove(i);
peer = cur;

View File

@@ -153,7 +153,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
_needsRebuild = true;
_context.statManager().createRateStat("udp.alreadyConnected", "What is the lifetime of a reestablished session", "udp", new long[] { 60*1000, 10*60*1000, 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.droppedPeer", "How long ago did we receive from a dropped peer (duration == session lifetime", "udp", new long[] { 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.droppedPeer", "How long ago did we receive from a dropped peer (duration == session lifetime", "udp", new long[] { 60*1000, 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.droppedPeerInactive", "How long ago did we receive from a dropped peer (duration == session lifetime)", "udp", new long[] { 60*1000, 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.statusOK", "How many times the peer test returned OK", "udp", new long[] { 5*60*1000, 20*60*1000, 60*60*1000, 24*60*60*1000 });
_context.statManager().createRateStat("udp.statusDifferent", "How many times the peer test returned different IP/ports", "udp", new long[] { 5*60*1000, 20*60*1000, 60*60*1000, 24*60*60*1000 });