question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Web seeds are slow or do not connect in a hybrid torrent

See original GitHub issue

When downloading a V2 torrent from the Internet Archive, it seems that webseeds are never connected to and the torrent never starts, or stalls after a few moments.

I suspect most torrents from the Internet Archive that are recently derived will have this issue.

this.TorrentClient = new ClientEngine();

var torrent = await this.TorrentClient.AddAsync(
                await Torrent.LoadAsync(torrentStream), 
                Path.Combine(Environment.CurrentDirectory, $"download"),
                new TorrentSettingsBuilder()
                {
                    CreateContainingDirectory = false,
                    
                    // encourage webseed use
                    WebSeedDelay = TimeSpan.Zero,
                    WebSeedSpeedTrigger = int.MaxValue,
                }.ToSettings());
await torrent.StartAsync();
await Task.Run(async () =>
            {
                while (torrent.State != TorrentState.Stopped && torrent.State != TorrentState.Paused && torrent.State != TorrentState.Seeding)
                {
                    if (cancel.IsCancellationRequested)
                    {
                        await torrent.StopAsync();
                        cancel.ThrowIfCancellationRequested();
                        break;
                    }
                    await Task.Delay(1000);
                    this.SpeedChangedEvent?.Invoke(this, torrent.Monitor.DownloadSpeed);
                    this.ProgressChangedEvent?.Invoke(this, torrent.PartialProgress);
                }

                var assetFile = torrent.Files.Single(f => f.Path.StartsWith(asset));
                return File.OpenRead(assetFile.FullPath);
            });

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alanmcgoverncommented, Jun 23, 2022

I updated https://github.com/alanmcgovern/monotorrent/pull/540 to make these timeouts configurable. I also increased the default values as per original PR.

Thanks for the report and for testing the tweaks! Hopefully that’s the only webseed issue you see :p

0reactions
alanmcgoverncommented, Jun 23, 2022

That’s what I experienced too.

The way to improve that is to request more data per http invocation. I’d have to double check, but it looks like the data was being requested in chunks of 4MB. There’s a latency of about 10-15 seconds for the server to accept the http request, which gives an effective throughput of about 0.5MB/sec. There are two http seeds so that gives a total throughput of nearly 1MB/sec.

Requesting I’m higher chunk sizes would be less beneficial if there were other peers sharing data. It would also be less beneficial if the server had “normal” latency when serving the response data.

Do you see any reasonable options to making this better, or is this the status quo after the timeout changr good enough that the webseed fallback is good enough for your needs?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connected to seeds, but not downloading : r/torrents
I am connected to three seeders in this one torrent, the only torrent I am downloading, but I am not downloading from them!...
Read more >
The Best qBittorrent Settings (2022 Update)
In this ultimate guide to qBittorrent, we'll go through the best qBittorrent settings to maximize your downloads speeds, privacy, and UX.
Read more >
Torrents with MANY SEEDS are very slow! - Speed Problems
I'm using uTorrent on Windows 7 through a Router. Ports are open, forwarded, allowed through firewall. Status is all green, internet speed ...
Read more >
Why is my torrent download speed so low while the seeds ...
There could be several reasons why your torrent download speed is low even though there are plenty of seeds: 1. Network congestion: If...
Read more >
What are some good settings for seeding a ton of torrents? ...
I'm running into a lot of trouble when trying to seed a lot of torrents( > 10k) with libtorrent. They include: Choking my...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found