Load Balancing & Capacity Awareness
Deep-dive page: how the overlay keeps storage and routing on peers that can actually carry them.
Sources in order of authority: current code (
com.p2pframework.monitoring/loadBalancing) first; then, newest first: Masinde's dissertation (2020) (capacity management protocol, replication-factor study) → CapSearch, AINA 2017 → PG 2012 report (redirected lookups) → Wette, adaptive load balancing (2011, simulation background).
The problem all generations attacked
A DHT assigns objects and routing responsibility by hash proximity, not by capability. Zipf-like request patterns and heterogeneous hardware (laptops, university pools, home routers) therefore overload some peers while others idle — for both storage (PAST replicas) and routing (routing-table maintenance is pure overhead for a weak node).
Step 1 — capacity signals in the overlay (2008–2009)
SkyEye aggregates not only counts but capacity attributes of the subtree below each monitor node (see monitoring systems); Graffi & Gross (IEEE P2P 2009) describes the management loop that consumes them — the precondition for any balancing decision (but note the exponential-bandwidth caveat documented there: capacity data must be filtered).
Step 2 — redirected lookups + provider lists (PG 2012)
Storage-side balancing in the Paderborn framework: each object keeps a provider list
(config length 20), peers consult it and issue a RedirectedLookupMessage to a peer that
announces capacity; weak/mobile nodes are deliberately kept out of routing tables and storage
but stay reachable via their neighbour set. Evaluation in a 10-machine pool showed only a small
time gain in the heterogeneity mode (615 vs. 624 successful photo downloads, −1.5 %) — honest
negative evidence that the policy, not the mechanism, was the bottleneck
(PG 2012).
Step 3 — capacity-based object placement: CapSearch (2017)
CapSearch builds a kd-tree over the capacity-annotated DHT objects and answers K-Search/Full-Search queries for the best hosts, with tree heights of 27/45 nodes in the measurements. Details and churn numbers on the search & CapSearch page (AINA 2017). This supersedes the flat provider-list idea: placement becomes a query, not a hint.
Step 4 — capacity management protocol (Masinde 2020, authoritative today)
The current protocol classifies peers as strong/weak continuously from storage, bandwidth, RAM, CPU, battery and connection type. Weak nodes take no routing tables and no replicas yet remain reachable through their neighbour set. At up to 75 % weak nodes the network stays stable, with disk traffic below 20 KB/s on weak peers and lookup load shifting to strong ones (dissertation). The same work measures replication: RF = leafsetSize/2 + 1 (tested 4/16/32); costs grow with RF, and a constant RF degrades performance non-linearly as the network grows — RF must scale with network size, a correction to earlier fixed-factor assumptions.
Simulation background (Wette 2011)
Wette's master thesis (Paderborn, before the LibreSocial codebase applied it) formalised "load = sent data per time, overload relative to upload capacity (>90 % threshold)" and simulated Adaptive-Chord: a second Capacity-Chord overlay ordered by free resources, where hot peers create mirrors on capable peers and redirect requests (+1 hop). In PeerfactSim.KOM (1000 peers, 10,000 files of 0–10 MB, Weibull churn) download times drop from 806.7 s to 85.9 s and success rates rise from 71.8 % to 97.1 % without churn; under churn download time roughly halves (e.g. 514.4 s → 186.1 s). It also showed the self-stabilising Chord variant Re-Chord collapses under real churn (O(n log n) stabilisation rounds) — one reason LibreSocial kept FreePastry's approach rather than switching rings (Wette 2011).
Code state today
com.p2pframework.monitoring.loadBalancing.LoadBalancingInfo— the monitoring→balancing information object is present in the current tree.- FreePastry's proximity/leaf-set machinery (
rice.freepastry) provides the placement substrate. - The strong/weak classification and RF policy from the dissertation live in the storage/routing decision paths exercised by the Tester suites (testing methodology).
Open work worth doing
- Re-run a heterogeneity experiment (strong/weak mix, e.g. the 75 %-weak scenario) on the Docker cluster where containers can be given cgroup limits — reproducible version of the 2020 numbers (blog: cluster testing, #108).
- Combine CapSearch results with RF scaling (place replicas on CapSearch-ranked hosts with network-growing RF) — currently two separate mechanisms (blog: security/roadmap cross-link aside, see work-item list).
Related
search & CapSearch · monitoring systems · caching · overlay component · storage dispatcher