Skip to main content

Module cache_radius_tracker

Module cache_radius_tracker 

Source
Expand description

§Cache-radius tracker for DHT walk pruning

Records, per-location and with a TTL, how far out in the DHT (measured in crate::tools::tools::LeadingAgreementBits) we’ve already seen cached copies of a given bundle. Subsequent DHT walks for the same location consult the tracker and skip peers that are closer than the recorded radius — those peers are almost certainly already cached — and instead try wider. This spreads cache load outward over time and relieves the small set of “closest” peers from being hammered for every read.

Uses parking_lot::RwLock because the tracker is read on every timeline walk but written only when a new cached hit comes back.

Structs§

CacheRadiusTracker
Per-location TTL store of the walk’s cache radius.