* NetDB: Increase floodfills and better adjustment based on available memory

This commit is contained in:
zzz
2011-06-14 18:29:04 +00:00
parent bb8b428598
commit 38537de758
2 changed files with 4 additions and 8 deletions

View File

@@ -26,8 +26,8 @@ class FloodfillMonitorJob extends JobImpl {
private static final int REQUEUE_DELAY = 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 int MIN_FF = 90;
private static final int MAX_FF = 180;
private static final int MIN_FF = 110;
private static final int MAX_FF = 220;
private static final String PROP_FLOODFILL_PARTICIPANT = "router.floodfillParticipant";
public FloodfillMonitorJob(RouterContext context, FloodfillNetworkDatabaseFacade facade) {

View File

@@ -367,12 +367,8 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
long maxMemory = Runtime.getRuntime().maxMemory();
if (maxMemory == Long.MAX_VALUE)
maxMemory = 128*1024*1024l;
if (maxMemory < 64*1024*1024)
MAX_DB_BEFORE_SKIPPING_SEARCH = 600;
else if (maxMemory < 128*1024*1024)
MAX_DB_BEFORE_SKIPPING_SEARCH = 900;
else
MAX_DB_BEFORE_SKIPPING_SEARCH = 1250;
// 250 for every 32 MB, min of 250, max of 1250
MAX_DB_BEFORE_SKIPPING_SEARCH = (int) Math.max(250l, Math.min(1250l, maxMemory / ((32 * 1024 * 1024l) / 250)));
}
/**