I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 36b446c0 authored by jrandom's avatar jrandom Committed by zzz
Browse files

* never drop the threshold under the baseline (the peer selection algorithm...

* never drop the threshold under the baseline (the peer selection algorithm can handle there being no fast peers, etc)
* revert some of the overly zealous peer distribution code - select randomly from the fast peers, not according to a strict LRU
(which was causing lots of queued up tunnel requests, as well as tunnel failures when they all failed)
need to think some more thunks about how to address this right now.  a few different algorithms available
to deal with different scenarios and #s of users, but nothing that by itself strikes me as 'ideal', yet.   perhaps its
time for another trip to the pub to see what inspiration can be found there ;)
parent ca70fc8d
No related branches found
No related tags found
No related merge requests found
......@@ -91,10 +91,11 @@ class PeerManager {
case PeerSelectionCriteria.PURPOSE_TUNNEL:
// pull all of the fast ones, regardless of how many we
// want - we'll whittle them down later (40 lines from now)
int num = _organizer.countFastPeers();
if (num <= 0)
num = criteria.getMaximumRequired();
_organizer.selectFastPeers(num, exclude, curVals);
// int num = _organizer.countFastPeers();
// if (num <= 0)
// num = criteria.getMaximumRequired();
// _organizer.selectFastPeers(num, exclude, curVals);
_organizer.selectFastPeers(criteria.getMaximumRequired(), exclude, curVals);
break;
case PeerSelectionCriteria.PURPOSE_SOURCE_ROUTE:
_organizer.selectHighCapacityPeers(criteria.getMinimumRequired(), exclude, curVals);
......@@ -133,6 +134,7 @@ class PeerManager {
if (_log.shouldLog(Log.INFO))
_log.info("Peers selected after " + numPasses + ": " + rv);
/*
if (criteria.getPurpose() == PeerSelectionCriteria.PURPOSE_TUNNEL) {
// we selected extra peers above. now lets strip that down to the
// minimum requested, ordering it by the least recently agreed to
......@@ -155,6 +157,7 @@ class PeerManager {
if (_log.shouldLog(Log.INFO))
_log.info("Peers selected after " + numPasses + ", sorted for a tunnel: " + rv);
}
*/
return rv;
}
......
......@@ -600,7 +600,8 @@ public class ProfileOrganizer {
}
} else {
// our average isn't doing well (its recovering from failures)
if (numExceedingBaseline > minHighCapacityPeers) {
_thresholdCapacityValue = baseline + 0.0000001;
/*if (numExceedingBaseline > minHighCapacityPeers) {
if (_log.shouldLog(Log.INFO))
_log.info("Our average capacity isn't doing well [" + meanCapacity
+ "], but the baseline has " + numExceedingBaseline);
......@@ -612,6 +613,7 @@ public class ProfileOrganizer {
+ " so falling back on the median of " + thresholdAtMedian);
_thresholdCapacityValue = thresholdAtMedian;
}
*/
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment