-
-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DHT does not work (properly) #14
Comments
Hmm interesting. Haven't really noticed any performances changes myself. Could you try using the vendored dht impl from the commit you reference in the current master and see if that gives you better performance? |
Yes. I just went to master, reverted to the vendor DHT (reverting only that commit + fixing the conflict + bringing back dht.js). There are no issues, the performance is as expected. The problem is not "worse" performance, it's no performance at all. With bittorrent-dht I get a very small amount of peers delivered and I somehow a tiny amount of them end up properly connected ( at best 1-2). I have never managed to start a download with bittorrent-dht. I am guessing it floods the network with too many UDP requests? No idea. |
Interesting - Are you using a magnet link or a torrent file? I'm actually pretty sure that bittorrent-dht uses way less udp traffic than my old vendored one. Maybe we can get some input from @feross on this? |
How are you measuring the amount of udp traffic? It would be interesting to dig deeper into this, but off the top of my head I can't think of an explanation for the difference. |
I'm using a torrent file. I'll try to measure the amount of UDP traffic later. |
I'm having the same exact issue. Bad to zero performance on This happens on some torrents, not all. Maybe the ones the tracker isn't good and DHT is a must... Take this torrent for instance: I'm getting ~5 connections on |
Hmm. Maybe we should just bring back the old tracker. Someone up for sending a PR? |
Could it be bittorrent-dht is being incorrectly used? I can't find any docs on this module, but looking at https://github.com/feross/webtorrent/blob/037bde2acdf897c8abfc4f0785bd523b3297f1d5/lib/torrent-manager.js#L55 i see they have to manually call I'm a bit busy right now, I'll do some tests later on this week. |
|
You're right.. I don't know what's happening. Peers are being found, but not connecting, apparently. |
In general the dht returns a lot of invalid peers (peers behind firewalls, etc). Could you do a bench where you test how many peers are returned from the dht using master vs 0.4.1? |
If we figure out the problem, let's update bittorrent-dht with the fix so others can benefit. I'll debug when I get some time. |
** Connections may or may not be from dht.. could be the tracker |
I've found out that setting the I think
|
Made an ugly implementation of I'll cleanup the code and make a PR to |
@ivantodorovich I'm seem to be getting better results using your patch! Your patch is available in torrent-stream 0.6.1 and peerflix 0.5.4 |
@feross Do you have any suggestions in general on how to more scientifically benchmark performance going forward (maybe something that could be useful for webtorrent as well)? |
@mafintosh Once webtorrent/bittorrent-dht#7 gets merged you'll see better results :) peer connections were timing out because of the network flooding.. Increasing |
Just an FYI, webtorrent/bittorrent-dht#7 is merged and published as bittorrent-dht@0.7.0 now. I agree that going forward we need something more scientific for benchmarking all these modules. I have too much on my plate right now with work and webtorrent, but if no one's tackled it in a month or so, I'll write something for this. Also, https://github.com/feross/bittorrent-dht has docs now. |
Looking good @feross. torrent-stream 0.7.1 uses bittorent-dht. 0.7.0. Could you guys (@ivantodorovich, @Ivshti) try out this version? |
This works properly, good job everyone! I also have to point out that the old bittorrent-dht also crashed my router very often. Does anyone have an explanation of how the DHT worked properly with mafintosh's dht.js? Did it have a request queue? |
Also, @mafintosh somehow the version you pushed to npm has a stale "var _ = require('underscore')" and I get a "cannot find module underscore" error unless I install it. |
@Ivshti could you share the stack so I can see the line? (On my mobile) |
Okay, sorry, after a fresh install on my workstation there is no such error. I don't know how that happened... |
Update: while this does work better, it still floods the connection sometimes. Thousands of peers are found but despite the fact I have a fast connection (but sadly a crappy vendor router which I cannot change), torrent-stream cannot establish any peer connections. @feross it might be a good idea to take a look of how @mafintosh's dht.js implements limits. |
@Ivshti I'll work on this as soon as I get a chance, but I'm traveling for the next week so I won't be able to work on it until I get back. I would accept a PR. |
I'm not aware of any outstanding performance issues related to |
Hello,
I haven't really dug into it but I have tested it several times and am 100% sure - when I start a torrent, it barely connects to 1-2 peers and those connections die quickly. I tried this with two ISP's. Since I remember an older version working perfectly, I went into the commit log and discovered the "using bittorrent-dht instead of vendored one" commit.
So I did
There is a dramatic difference - in this case, everything works as expected.
The text was updated successfully, but these errors were encountered: