You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
client: peer-store latency folds cold-miss TTFB, so the fast path ranks nearby nodes behind the origin #2196
area:clidecdn binary: get, gateway, pool, publish, origin, setupkind:bugSomething does not behave as documentedprio:mediumScheduledrustDependabot: a Cargo update; use area: labels for Rust code otherwise
The client peer store (~/.decdn/client/peers/*.json) ranks nodes by latency_ms, an EWMA that folds in two different measures:
the probe RTT (spawn_harvest, crates/cli/src/commands/fetch.rs), and
the stream time-to-first-byte of every opened entry (record_sample(… header.ttfb_ms …) in the fetch path, fetch.rs about line 2565).
On a cold miss, the serving node must first pull from an upstream holder. So its TTFB includes a whole second leg, and measures the content's cache state, not the node's distance.
Peer store after a mistral-7b bundle pull, against ICMP RTT from the same host:
node
region
stored latency_ms
ICMP RTT
fra1
DE
1051
57 ms
lon1
GB
1167
78 ms
nbg1
DE
1129
—
hel1
FI
1768
—
bcl (sole origin)
US
394
ICMP blocked; transatlantic
The EU nodes were serving cold two-leg misses from bcl, so they look 15–20× slower than their RTT. bcl serves from its origin, so it looks fastest.
Impact
store_fast_path sorts candidates by this value and skips the probe round when at least MIN_FRESH_CANDIDATES samples are younger than LATENCY_TTL_SECS (10 min). A follow-up fetch or bundle entry inside that window prefers the origin node over nearby nodes that now hold the content warm. That concentrates load on the origin, and nearby caches stay unused after they fill.
Expected
The ranking signal measures the node, not the content's cache state. Options:
Fold only probe RTT (or handshake RTT) into latency_ms, and keep stream TTFB as a separate field or drop it.
Fold TTFB only from streams the node served from cache. The serve response or header can say hit or miss.
Either way, a cold miss must not rank a nearby node behind a distant origin for the next 10 minutes.
area:clidecdn binary: get, gateway, pool, publish, origin, setupkind:bugSomething does not behave as documentedprio:mediumScheduledrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Activity