ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.02k stars 3k forks source link

go-ipfs should measure peer latency from more subsystems than just the DHT #6161

Open MichaelMure opened 5 years ago

MichaelMure commented 5 years ago

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:

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 ?

Stebalien commented 5 years ago

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.