forked from I2P_Developers/i2p.i2p
* NetDB: Increase floodfills and better adjustment based on available memory
This commit is contained in:
@@ -26,8 +26,8 @@ class FloodfillMonitorJob extends JobImpl {
|
|||||||
private static final int REQUEUE_DELAY = 60*60*1000;
|
private static final int REQUEUE_DELAY = 60*60*1000;
|
||||||
private static final long MIN_UPTIME = 2*60*60*1000;
|
private static final long MIN_UPTIME = 2*60*60*1000;
|
||||||
private static final long MIN_CHANGE_DELAY = 6*60*60*1000;
|
private static final long MIN_CHANGE_DELAY = 6*60*60*1000;
|
||||||
private static final int MIN_FF = 90;
|
private static final int MIN_FF = 110;
|
||||||
private static final int MAX_FF = 180;
|
private static final int MAX_FF = 220;
|
||||||
private static final String PROP_FLOODFILL_PARTICIPANT = "router.floodfillParticipant";
|
private static final String PROP_FLOODFILL_PARTICIPANT = "router.floodfillParticipant";
|
||||||
|
|
||||||
public FloodfillMonitorJob(RouterContext context, FloodfillNetworkDatabaseFacade facade) {
|
public FloodfillMonitorJob(RouterContext context, FloodfillNetworkDatabaseFacade facade) {
|
||||||
|
@@ -367,12 +367,8 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
|
|||||||
long maxMemory = Runtime.getRuntime().maxMemory();
|
long maxMemory = Runtime.getRuntime().maxMemory();
|
||||||
if (maxMemory == Long.MAX_VALUE)
|
if (maxMemory == Long.MAX_VALUE)
|
||||||
maxMemory = 128*1024*1024l;
|
maxMemory = 128*1024*1024l;
|
||||||
if (maxMemory < 64*1024*1024)
|
// 250 for every 32 MB, min of 250, max of 1250
|
||||||
MAX_DB_BEFORE_SKIPPING_SEARCH = 600;
|
MAX_DB_BEFORE_SKIPPING_SEARCH = (int) Math.max(250l, Math.min(1250l, maxMemory / ((32 * 1024 * 1024l) / 250)));
|
||||||
else if (maxMemory < 128*1024*1024)
|
|
||||||
MAX_DB_BEFORE_SKIPPING_SEARCH = 900;
|
|
||||||
else
|
|
||||||
MAX_DB_BEFORE_SKIPPING_SEARCH = 1250;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user