Changeset ea9c4a19


Ignore:
Timestamp:
Dec 11, 2015 3:40:11 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
00d6a49
Parents:
7680ecb
Message:

Router, naming, I2CP: Increase lookup cache max sizes (except on Android),
reduce max lookup depth, and increase non-floodfill profile bonus
to attempt to reduce load on floodfills

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/client/impl/I2PSessionImpl.java

    r7680ecb rea9c4a19  
    171171    private volatile boolean _routerSupportsHostLookup;
    172172
     173    protected static final int CACHE_MAX_SIZE = SystemVersion.isAndroid() ? 32 : 128;
    173174    /**
    174175     *  Since 0.9.11, key is either a Hash or a String
    175176     *  @since 0.8.9
    176177     */
    177     private static final Map<Object, Destination> _lookupCache = new LHMCache<Object, Destination>(64);
     178    private static final Map<Object, Destination> _lookupCache = new LHMCache<Object, Destination>(CACHE_MAX_SIZE);
    178179    private static final String MIN_HOST_LOOKUP_VERSION = "0.9.11";
    179180    private static final boolean TEST_LOOKUP = false;
  • core/java/src/net/i2p/client/naming/DummyNamingService.java

    r7680ecb rea9c4a19  
    1616import net.i2p.data.Destination;
    1717import net.i2p.util.LHMCache;
     18import net.i2p.util.SystemVersion;
    1819
    1920/**
     
    2425    protected static final int BASE32_HASH_LENGTH = 52;   // 1 + Hash.HASH_LENGTH * 8 / 5
    2526    public final static String PROP_B32 = "i2p.naming.hostsTxt.useB32";
    26     protected static final int CACHE_MAX_SIZE = 32;
     27    protected static final int CACHE_MAX_SIZE = SystemVersion.isAndroid() ? 32 : 128;
    2728    public static final int DEST_SIZE = 516;                    // Std. Base64 length (no certificate)
    2829
  • router/java/src/net/i2p/router/networkdb/kademlia/IterativeSearchJob.java

    r7680ecb rea9c4a19  
    7575    private static final int MAX_NON_FF = 3;
    7676    /** Max number of peers to query */
    77     private static final int TOTAL_SEARCH_LIMIT = 6;
     77    private static final int TOTAL_SEARCH_LIMIT = 5;
    7878    /** Max number of peers to query if we are ff */
    7979    private static final int TOTAL_SEARCH_LIMIT_WHEN_FF = 3;
     
    540540        }
    541541        // blame the unheard-from (others already blamed in failed() above)
    542         for (Hash h : unheard)
     542        for (Hash h : unheard) {
    543543            getContext().profileManager().dbLookupFailed(h);
     544        }
    544545        long time = System.currentTimeMillis() - _created;
    545546        if (_log.shouldLog(Log.INFO)) {
     
    548549                      ", peers queried: " + tries);
    549550        }
    550         getContext().statManager().addRateData("netDb.failedTime", time);
    551         getContext().statManager().addRateData("netDb.failedRetries", Math.max(0, tries - 1));
     551        if (tries > 0) {
     552            // don't bias the stats with immediate fails
     553            getContext().statManager().addRateData("netDb.failedTime", time);
     554            getContext().statManager().addRateData("netDb.failedRetries", tries - 1);
     555        }
    552556        for (Job j : _onFailed) {
    553557            getContext().jobQueue().addJob(j);
  • router/java/src/net/i2p/router/peermanager/CapacityCalculator.java

    r7680ecb rea9c4a19  
    3030    // we make this a bonus for non-ff, not a penalty for ff, so we
    3131    // don't drive the ffs below the default
    32     private static final double BONUS_NON_FLOODFILL = 0.5;
     32    private static final double BONUS_NON_FLOODFILL = 1.0;
    3333   
    3434    public static double calc(PeerProfile profile) {
Note: See TracChangeset for help on using the changeset viewer.