2007-03-03 zzz

* Implement priority sending for NTCP
    * Disable trimForOverload() in tunnel BuildExecutor which
      was preventing tunnel builds when outbound traffic was high
      (i.e. most of the time when running i2psnark)
This commit is contained in:
zzz
2007-03-03 20:11:05 +00:00
committed by zzz
parent ce50efa60c
commit 1bbd2cf52e
4 changed files with 26 additions and 8 deletions

View File

@ -1,4 +1,10 @@
$Id: history.txt,v 1.552 2007-02-28 21:22:16 zzz Exp $
$Id: history.txt,v 1.553 2007-02-28 21:29:12 zzz Exp $
2007-03-03 zzz
* Implement priority sending for NTCP
* Disable trimForOverload() in tunnel BuildExecutor which
was preventing tunnel builds when outbound traffic was high
(i.e. most of the time when running i2psnark)
2007-02-28 zzz
* i2psnark: File reopen cleanup

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.488 $ $Date: 2007-02-28 21:22:14 $";
public final static String ID = "$Revision: 1.489 $ $Date: 2007-02-28 21:29:11 $";
public final static String VERSION = "0.6.1.27";
public final static long BUILD = 2;
public final static long BUILD = 3;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -582,12 +582,22 @@ public class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener {
return;
}
//throw new RuntimeException("We should not be preparing a write while we still have one pending");
if (_outbound.size() > 0) {
if (queueTime() > 3*1000) { // don't stall low-priority messages
msg = (OutNetMessage)_outbound.remove(0);
_currentOutbound = msg;
} else {
return;
Iterator it = _outbound.iterator();
for (int i = 0; it.hasNext() && i < 75; i++) { //arbitrary bound
OutNetMessage mmsg = (OutNetMessage) it.next();
if (msg == null || mmsg.getPriority() > msg.getPriority())
msg = mmsg;
}
if (msg == null)
return;
// if (_outbound.indexOf(msg) > 0)
// _log.debug("Priority message sent, pri = " + msg.getPriority() + " pos = " + _outbound.indexOf(msg) + "/" +_outbound.size());
_outbound.remove(msg);
}
_currentOutbound = msg;
}
msg.beginTransmission();

View File

@ -156,7 +156,8 @@ class BuildExecutor implements Runnable {
// Trim the number of allowed tunnels for overload,
// initiate a tunnel drop on severe overload
allowed = trimForOverload(allowed,concurrent);
// tunnel building is high priority, don't do this
// allowed = trimForOverload(allowed,concurrent);
return allowed;
}
@ -168,6 +169,7 @@ class BuildExecutor implements Runnable {
/**
* Don't even try to build tunnels if we're saturated
*/
/*
private int trimForOverload(int allowed, int concurrent) {
// dont include the inbound rates when throttling tunnel building, since
@ -221,7 +223,7 @@ class BuildExecutor implements Runnable {
// No overload, allow as requested
return(allowed);
}
*/
public void run() {
_isRunning = true;