Currently, go-ipfs records peer latencies (peerstore.Metrics.RecordLatency(peer.ID, time.Duration)) from only two sources:
user triggered ping using ipfs ping <peer>
DHT requests (message that will lead to a response, not one off)
This situation lead to ipfs swarm peers --latency getting filled by peers with n/a latencies, because no latencies has ever been recorded for them. I expect that also leads to some bad decision when the connection manager has to drop some of them.
My point is, go-ipfs should record latencies from more subsystem. Maybe bitswap ?
Currently, we only use latencies when making decisions in the DHT but I agree we should measure latencies in more places. Bitswap is hard because peers don't send blocks immediately, they put the user in a queue.
Version information:
go-ipfs version: 0.4.19- Repo version: 7 System version: amd64/linux Golang version: go1.11.5
Type: enhancement
Description:
Currently, go-ipfs records peer latencies (
peerstore.Metrics.RecordLatency(peer.ID, time.Duration)
) from only two sources:ipfs ping <peer>
This situation lead to
ipfs swarm peers --latency
getting filled by peers withn/a
latencies, because no latencies has ever been recorded for them. I expect that also leads to some bad decision when the connection manager has to drop some of them.My point is, go-ipfs should record latencies from more subsystem. Maybe bitswap ?