anacrolix / torrent

Full-featured BitTorrent client package and utilities
Mozilla Public License 2.0
5.39k stars 615 forks source link

Webseed download extremely slow #869

Open gaobo9109 opened 9 months ago

gaobo9109 commented 9 months ago

I am trying to figure out why download using webseed is extremely slow.

When I try to download with tracker enabled, the client will try to download from three seed nodes. The download speed looks normal at this point.

image

However, when I disabled tracker and force the client to download only from webseed url, the speed is very slow.

image

It looks like the client only manages to acquire one to three pieces every second, where as with tracker enabled, the client is able to acquire 100 pieces every second.

I have tried to download the file directly from the server using http request, able to achieve above 100 MB/s download speed, so server latency is not an issue.

Why is there such a drastic difference between downloading from normal seed nodes as compared to webseed?

anacrolix commented 9 months ago

The webseeding implementation is not very efficient. It makes small HTTP byte range requests to the webseed endpoints that are not efficient, but structured to shoehorn the webseed client into the same request prioritization algorithm used for regular peers. BEP 19 describes a more efficient way to do this that is not implemented here.

Generally I would advise to use webseeding as a last resort (not many peers, or not all data is available from regular peers) in it's current form.