Changeset 348805f0


Ignore:
Timestamp:
Dec 1, 2015 8:12:31 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b53fe37
Parents:
72527f4
Message:

i2psnark:

  • Consolidate default tunnel length definition
  • Increase max peers and uploaders per torrent
  • Increase default max total uploaders
  • Increase max peers sent and returned in DHT
Location:
apps/i2psnark/java/src/org/klomp/snark
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java

    r72527f4 r348805f0  
    7676    public static final int DEFAULT_STARTUP_DELAY = 3;
    7777    public static final boolean DEFAULT_USE_OPENTRACKERS = true;
    78     public static final int MAX_CONNECTIONS = 16; // per torrent
     78    public static final int MAX_CONNECTIONS = 24; // per torrent
    7979    public static final String PROP_MAX_BW = "i2cp.outboundBytesPerSecond";
    8080    public static final boolean DEFAULT_USE_DHT = true;
  • apps/i2psnark/java/src/org/klomp/snark/IdleChecker.java

    r72527f4 r348805f0  
    121121        String i = opts.get("inbound.quantity");
    122122        if (i == null)
    123             i = "3";
     123            i = Integer.toString(SnarkManager.DEFAULT_TUNNEL_QUANTITY);
    124124        String o = opts.get("outbound.quantity");
    125125        if (o == null)
    126             o = "3";
     126            o = Integer.toString(SnarkManager.DEFAULT_TUNNEL_QUANTITY);
    127127        String ib = opts.get("inbound.backupQuantity");
    128128        if (ib == null)
  • apps/i2psnark/java/src/org/klomp/snark/PeerCoordinator.java

    r72527f4 r348805f0  
    7171  // package local for access by CheckDownLoadersTask
    7272  final static long CHECK_PERIOD = 40*1000; // 40 seconds
    73   final static int MAX_UPLOADERS = 6;
     73  final static int MAX_UPLOADERS = 8;
    7474  public static final long MAX_INACTIVE = 8*60*1000;
    7575
     
    404404   *  reduce max if huge pieces to keep from ooming when leeching
    405405   *  but now we don't
    406    *  @return usually 16       
     406   *  @return usually I2PSnarkUtil.MAX_CONNECTIONS
    407407   */
    408408  private int getMaxConnections() {
  • apps/i2psnark/java/src/org/klomp/snark/Snark.java

    r72527f4 r348805f0  
    13301330   */
    13311331  final static int MIN_TOTAL_UPLOADERS = 4;
    1332   final static int MAX_TOTAL_UPLOADERS = 10;
     1332  final static int MAX_TOTAL_UPLOADERS = 20;
    13331333
    13341334  public boolean overUploadLimit(int uploaders) {
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    r72527f4 r348805f0  
    134134    public static final int DEFAULT_REFRESH_DELAY_SECS = 60;
    135135    private static final int DEFAULT_PAGE_SIZE = 50;
     136    public static final int DEFAULT_TUNNEL_QUANTITY = 3;
    136137    public static final String CONFIG_DIR_SUFFIX = ".d";
    137138    private static final String SUBDIR_PREFIX = "s";
     
    611612            _config.setProperty(PROP_I2CP_PORT, "7654");
    612613        if (!_config.containsKey(PROP_I2CP_OPTS))
    613             _config.setProperty(PROP_I2CP_OPTS, "inbound.length=3 outbound.length=3 inbound.quantity=3 outbound.quantity=3");
     614            _config.setProperty(PROP_I2CP_OPTS, "inbound.length=3 outbound.length=3" +
     615                                                " inbound.quantity=" + DEFAULT_TUNNEL_QUANTITY +
     616                                                " outbound.quantity=" + DEFAULT_TUNNEL_QUANTITY);
    614617        //if (!_config.containsKey(PROP_EEP_HOST))
    615618        //    _config.setProperty(PROP_EEP_HOST, "127.0.0.1");
  • apps/i2psnark/java/src/org/klomp/snark/dht/KRPC.java

    r72527f4 r348805f0  
    4141import net.i2p.util.SimpleTimer2;
    4242
     43import org.klomp.snark.I2PSnarkUtil;
    4344import org.klomp.snark.SnarkManager;
    4445import org.klomp.snark.TrackerClient;
     
    129130    /** Max number of nodes to return. BEP 5 says 8 */
    130131    private static final int K = 8;
    131     /** Max number of peers to return. BEP 5 doesn't say. We'll use the same as I2PSnarkUtil.MAX_CONNECTIONS */
    132     private static final int MAX_WANT = 16;
     132    /** Max number of peers to return. BEP 5 doesn't say.
     133     * We'll use more than I2PSnarkUtil.MAX_CONNECTIONS since lots could be old.
     134     */
     135    private static final int MAX_WANT = I2PSnarkUtil.MAX_CONNECTIONS * 3 / 2;
    133136
    134137    /** overloads error codes which start with 201 */
     
    14131416        if (_log.shouldLog(Log.INFO))
    14141417             _log.info("Rcvd peers from: " + nInfo);
    1415         int max = Math.min(MAX_WANT, peers.size());
     1418        int max = Math.min(MAX_WANT * 2, peers.size());
    14161419        List<Hash> rv = new ArrayList<Hash>(max);
    14171420        for (BEValue bev : peers) {
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r72527f4 r348805f0  
    23062306        out.write(_t("Inbound Settings"));
    23072307        out.write(":<td>");
    2308         out.write(renderOptions(1, 10, 3, options.remove("inbound.quantity"), "inbound.quantity", TUNNEL));
     2308        out.write(renderOptions(1, 10, SnarkManager.DEFAULT_TUNNEL_QUANTITY,
     2309                                options.remove("inbound.quantity"), "inbound.quantity", TUNNEL));
    23092310        out.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
    23102311        out.write(renderOptions(0, 4, 3, options.remove("inbound.length"), "inbound.length", HOP));
     
    23122313        out.write(_t("Outbound Settings"));
    23132314        out.write(":<td>");
    2314         out.write(renderOptions(1, 10, 3, options.remove("outbound.quantity"), "outbound.quantity", TUNNEL));
     2315        out.write(renderOptions(1, 10, SnarkManager.DEFAULT_TUNNEL_QUANTITY,
     2316                                options.remove("outbound.quantity"), "outbound.quantity", TUNNEL));
    23152317        out.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
    23162318        out.write(renderOptions(0, 4, 3, options.remove("outbound.length"), "outbound.length", HOP));
Note: See TracChangeset for help on using the changeset viewer.