* i2psnark:

- Randomize the PeerCheckerTask start times to make global limiting
        work better
      - Calculate bw limits using 40s rather than 4m averages to make
        bw limiting work better
      - Change default bw limit from uplimit/3 to uplimit/2 due to
        overhead reduction from the leaseset bundling change
This commit is contained in:
zzz
2008-05-12 13:53:11 +00:00
parent d81bff267a
commit bc5d87e6f0
7 changed files with 40 additions and 9 deletions

View File

@ -87,7 +87,10 @@ public class PeerCoordinator implements PeerListener
setWantedPieces();
// Install a timer to check the uploaders.
timer.schedule(new PeerCheckerTask(this), CHECK_PERIOD, CHECK_PERIOD);
// Randomize the first start time so multiple tasks are spread out,
// this will help the behavior with global limits
Random r = new Random();
timer.schedule(new PeerCheckerTask(this), (CHECK_PERIOD / 2) + r.nextInt((int) CHECK_PERIOD), CHECK_PERIOD);
}
// only called externally from Storage after the double-check fails
@ -192,6 +195,15 @@ public class PeerCoordinator implements PeerListener
return getRate(uploaded_old);
}
public long getCurrentUploadRate()
{
// no need to synchronize, only one value
long r = uploaded_old[0];
if (r <= 0)
return 0;
return (r * 1000) / CHECK_PERIOD;
}
private long getRate(long array[])
{
long rate = 0;

View File

@ -785,9 +785,10 @@ public class Snark
for (Iterator iter = coordinators.iterator(); iter.hasNext(); ) {
PeerCoordinator c = (PeerCoordinator)iter.next();
if (!c.halted())
total += c.getUploadRate();
total += c.getCurrentUploadRate();
}
long limit = 1024l * I2PSnarkUtil.instance().getMaxUpBW();
Snark.debug("Total up bw: " + total + " Limit: " + limit, Snark.WARNING);
return total > limit;
}
}

View File

@ -119,7 +119,7 @@ public class SnarkManager implements Snark.CompleteListener {
_config.setProperty(PROP_UPLOADERS_TOTAL, "" + Snark.MAX_TOTAL_UPLOADERS);
if (!_config.containsKey(PROP_UPBW_MAX)) {
if (_context instanceof RouterContext)
_config.setProperty(PROP_UPBW_MAX, "" + (((RouterContext)_context).bandwidthLimiter().getOutboundKBytesPerSecond() / 3));
_config.setProperty(PROP_UPBW_MAX, "" + (((RouterContext)_context).bandwidthLimiter().getOutboundKBytesPerSecond() / 2));
else
_config.setProperty(PROP_UPBW_MAX, "" + DEFAULT_MAX_UP_BW);
}

View File

@ -703,7 +703,7 @@ public class I2PSnarkServlet extends HttpServlet {
out.write("Total uploader limit: <input type=\"text\" name=\"upLimit\" value=\""
+ I2PSnarkUtil.instance().getMaxUploaders() + "\" size=\"3\" maxlength=\"3\" /> peers<br />\n");
out.write("Up bandwidth limit: <input type=\"text\" name=\"upBW\" value=\""
+ I2PSnarkUtil.instance().getMaxUpBW() + "\" size=\"3\" maxlength=\"3\" /> KBps <i>(Router Up BW / 3 recommended)</i><br />\n");
+ I2PSnarkUtil.instance().getMaxUpBW() + "\" size=\"3\" maxlength=\"3\" /> KBps <i>(Router Up BW / 2 recommended)</i><br />\n");
out.write("Use open trackers also: <input type=\"checkbox\" name=\"useOpenTrackers\" value=\"true\" "
+ (useOpenTrackers ? "checked " : "")

View File

@ -1,3 +1,24 @@
2008-05-12 zzz
* Outbound message:
- Tweak the cache key for efficiency
* Stats:
- Require two udp stats when stats.full=false, caused NPE on peers.jsp
* Summary bar:
- Add messages when dropping tunnel requests due to load
* Update Handler:
- Add postman to the list
* i2psnark:
- Randomize the PeerCheckerTask start times to make global limiting
work better
- Calculate bw limits using 40s rather than 4m averages to make
bw limiting work better
- Change default bw limit from uplimit/3 to uplimit/2 due to
overhead reduction from the leaseset bundling change
* libjbigi:
- Add documentation on dynamic build option
- Add two speed tests to the build script
- Clean up the build script, make it easier to build dynamic
2008-05-10 zzz
* NetDb: Don't write the my.info file to disk, it isn't used for anything
* Stats:

View File

@ -28,10 +28,7 @@ should improve the reliability of the whole network.
<p>
&#149;
2008-02-05: <b>Upgrading from 0.6.1.30 and Earlier Releases</b>
</p><p>
Full instructions are posted at
<a href="http://www.i2p2.i2p/upgrade-0.6.1.30.html">www.i2p2.i2p/upgrade-0.6.1.30.html</a>.
2008-02-05: <b><a href="http://www.i2p2.i2p/upgrade-0.6.1.30.html">Upgrading from 0.6.1.30 and Earlier Releases</a></b>
</p>
<!--

View File

@ -17,7 +17,7 @@ import net.i2p.CoreVersion;
public class RouterVersion {
public final static String ID = "$Revision: 1.548 $ $Date: 2008-02-10 15:00:00 $";
public final static String VERSION = "0.6.1.33";
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);