anacrolix / dht

dht is used by anacrolix/torrent, and is intended for use as a library in other projects both torrent related and otherwise
Mozilla Public License 2.0
313 stars 66 forks source link

Seems to find peers very slowly compared to webtorrent/torrent-discovery #23

Closed bsuh closed 6 years ago

bsuh commented 6 years ago

Only using DHT to find peers, https://github.com/webtorrent/torrent-discovery (through peerflix) connects to ~20 peers instantly while this package (through confluence) connects to 1 peer in 20 seconds.

I have some packet captures. packet-capture.zip

bsuh commented 6 years ago

Additional context. Host machine is OS X. peerflix and confluence running inside Docker containers. confluence running on OS X seems to find peers fine.

After looking at the packet captures (I thought they would be too opaque for me to understand at first), it seems that the problem is just for some reason the TCP connection establishing packets aren't being ACK'd. Why would that be a problem for confluence but not peerflix?

bsuh commented 6 years ago

Based on additional tests on Linux host (VM I provisioned from a hosting provider) running confluence, confluence in Docker, confluence + openvpn in Docker, this seems to be a Docker + some distinct way that the socket is set up that is causing problems.

EDIT: confluence in Docker on Linux host started working. I think it's Docker for Mac

anacrolix commented 6 years ago

It's possibly related to #24, could you try with the fix for that, https://github.com/anacrolix/dht/commit/efcc29278754bdd5e766edfb6675f3fe0199fc6f?

bsuh commented 6 years ago

Seems to be fixed!