From f87d006a1c98253b4797e4cba0fe06f53b7f20b0 Mon Sep 17 00:00:00 2001 From: dg2-new Date: Sun, 15 Feb 2015 22:40:36 +0000 Subject: [PATCH] FloodfillMonitorJob: - Use lifetime average value for job lag - Change the job lag limit to less than 25ms - Consider and set the limit of backlogged tunnels to less than 5 --- history.txt | 6 ++++++ router/java/src/net/i2p/router/RouterVersion.java | 2 +- .../i2p/router/networkdb/kademlia/FloodfillMonitorJob.java | 7 +++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/history.txt b/history.txt index fd79304253..89165adee1 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,9 @@ +2015-02-15 dg + * FloodfillMonitorJob: + - Use lifetime average value for job lag + - Change the job lag limit to less than 25ms + - Consider and set the limit of backlogged tunnels to less than 5 + 2015-02-10 dg * I2PSnark, Jetty, SAM, crypto: findbugs resource leaks. diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 0bd65feeba..7f0b07e778 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 23; + public final static long BUILD = 24; /** for example "-test" */ public final static String EXTRA = ""; diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java index fa0af6d783..3312ab7d57 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java @@ -150,8 +150,11 @@ class FloodfillMonitorJob extends JobImpl { int good = ffcount - failcount; boolean happy = getContext().router().getRouterInfo().getCapabilities().indexOf("R") >= 0; // TODO - limit may still be too high - // TODO - use jobQueue.jobLag stat instead? - happy = happy && getContext().jobQueue().getMaxLag() < 100; + // For reference, the avg lifetime job lag on my Pi is 6. + // Would per-hour or per-day be better than lifetime avg? A reference to avg. dropped ff jobs maybe? + RateStat lagStat = getContext().statManager().getRate("jobQueue.jobLag"); + happy = happy && lagStat.getLifetimeAverageValue() < 25; + happy = happy && getContext().tunnelManager().getInboundBuildQueueSize() < 5; // Only if we're pretty well integrated... happy = happy && _facade.getKnownRouters() >= 200; happy = happy && getContext().commSystem().countActivePeers() >= 50;