* 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 ;)
This commit is contained in:
jrandom
2004-08-26 08:07:48 +00:00
committed by zzz
parent ca70fc8dc8
commit 36b446c012
2 changed files with 10 additions and 5 deletions

View File

@ -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;
}

View File

@ -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;
}
*/
}
}