diff --git a/router/java/src/net/i2p/router/transport/FIFOBandwidthRefiller.java b/router/java/src/net/i2p/router/transport/FIFOBandwidthRefiller.java index 1358686cd331a45f2a0879b8a8a9fc5eb0a4c9ca..3ba1515af6f131f4f8d8846f9dc926f21bf19b05 100644 --- a/router/java/src/net/i2p/router/transport/FIFOBandwidthRefiller.java +++ b/router/java/src/net/i2p/router/transport/FIFOBandwidthRefiller.java @@ -75,7 +75,7 @@ public class FIFOBandwidthRefiller implements Runnable { * Do not increase without adding a new Bloom filter size! * See util/DecayingBloomFilter and tunnel/BloomFilterIVValidator. */ - public static final int MAX_OUTBOUND_BANDWIDTH = 8192; + public static final int MAX_OUTBOUND_BANDWIDTH = 16384; /** * how often we replenish the queues. diff --git a/router/java/src/net/i2p/router/tunnel/BloomFilterIVValidator.java b/router/java/src/net/i2p/router/tunnel/BloomFilterIVValidator.java index beb6ec438b0a00c471d63b5e5d909f7d4c1b2f0d..9c8bf9d77222de4db4c81921691ec6d8cc908681 100644 --- a/router/java/src/net/i2p/router/tunnel/BloomFilterIVValidator.java +++ b/router/java/src/net/i2p/router/tunnel/BloomFilterIVValidator.java @@ -30,10 +30,12 @@ class BloomFilterIVValidator implements IVValidator { private static final int MIN_SHARE_KBPS_FOR_BIG_BLOOM = 512; private static final int MIN_SHARE_KBPS_FOR_HUGE_BLOOM = 1536; private static final int MIN_SHARE_KBPS_FOR_HUGE2_BLOOM = 4096; + private static final int MIN_SHARE_KBPS_FOR_HUGE3_BLOOM = 8192; private static final long MIN_MEM_TO_USE_BLOOM = 64*1024*1024l; private static final long MIN_MEM_FOR_BIG_BLOOM = 128*1024*1024l; private static final long MIN_MEM_FOR_HUGE_BLOOM = 256*1024*1024l; private static final long MIN_MEM_FOR_HUGE2_BLOOM = 384*1024*1024l; + private static final long MIN_MEM_FOR_HUGE3_BLOOM = 512*1024*1024l; /** for testing */ private static final String PROP_FORCE = "router.forceDecayingBloomFilter"; /** for testing */ @@ -57,8 +59,12 @@ class BloomFilterIVValidator implements IVValidator { if (KBps >= MIN_SHARE_KBPS_TO_USE_BLOOM) warn(maxMemory, KBps, MIN_MEM_TO_USE_BLOOM, MIN_SHARE_KBPS_TO_USE_BLOOM); _filter = new DecayingHashSet(ctx, HALFLIFE_MS, 16, "TunnelIVV"); // appx. 4MB max + } else if (KBps >= MIN_SHARE_KBPS_FOR_HUGE3_BLOOM && maxMemory >= MIN_MEM_FOR_HUGE3_BLOOM) { + _filter = new DecayingBloomFilter(ctx, HALFLIFE_MS, 16, "TunnelIVV", 27); // 32MB fixed } else if (KBps >= MIN_SHARE_KBPS_FOR_HUGE2_BLOOM && maxMemory >= MIN_MEM_FOR_HUGE2_BLOOM) { _filter = new DecayingBloomFilter(ctx, HALFLIFE_MS, 16, "TunnelIVV", 26); // 16MB fixed + if (KBps >= MIN_SHARE_KBPS_FOR_HUGE3_BLOOM) + warn(maxMemory, KBps, MIN_MEM_FOR_HUGE3_BLOOM, MIN_SHARE_KBPS_FOR_HUGE3_BLOOM); } else if (KBps >= MIN_SHARE_KBPS_FOR_HUGE_BLOOM && maxMemory >= MIN_MEM_FOR_HUGE_BLOOM) { if (KBps >= MIN_SHARE_KBPS_FOR_HUGE2_BLOOM) warn(maxMemory, KBps, MIN_MEM_FOR_HUGE2_BLOOM, MIN_SHARE_KBPS_FOR_HUGE2_BLOOM); diff --git a/router/java/src/net/i2p/router/util/DecayingBloomFilter.java b/router/java/src/net/i2p/router/util/DecayingBloomFilter.java index a5910e36efbb023735d05c3ad90aa75488ed9fca..bafd1c2c88dbbe2d529678d02f3ba514790a4310 100644 --- a/router/java/src/net/i2p/router/util/DecayingBloomFilter.java +++ b/router/java/src/net/i2p/router/util/DecayingBloomFilter.java @@ -86,16 +86,24 @@ public class DecayingBloomFilter { this(context, durationMs, entryBytes, name, context.getProperty("router.decayingBloomFilterM", DEFAULT_M)); } - /** @param m filter size exponent */ + /** + * @param m filter size exponent, max is 29 + */ public DecayingBloomFilter(I2PAppContext context, int durationMs, int entryBytes, String name, int m) { _context = context; _log = context.logManager().getLog(DecayingBloomFilter.class); _entryBytes = entryBytes; _name = name; int k = DEFAULT_K; - // max is (23,11) or (26,10); see KeySelector for details - if (m > DEFAULT_M) + // max is (23,11) or (26,10) or (29,9); see KeySelector for details + if (m > DEFAULT_M) { k--; + if (m > 26) { + k--; + if (m > 29) + throw new IllegalArgumentException("Max m is 29"); + } + } _current = new BloomSHA1(m, k); _previous = new BloomSHA1(m, k); _durationMs = durationMs; @@ -375,6 +383,9 @@ public class DecayingBloomFilter { * * Following stats for m=26, k=10: * 4096 7.3E-6; 5120 4.5E-5; 6144 1.8E-4; 8192 0.14%; 10240 0.6%, 12288 1.7% + * + * Following stats for m=27, k=9: + * 8192 1.1E-5; 10240 5.6E-5; 12288 2.0E-4; 14336 5.8E-4; 16384 0.14% *</pre> */ /*****