Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upToo many pieces in progress with rarest strategy. #1558
Labels
Comments
This comment has been minimized.
This comment has been minimized.
|
I like this, I need free time >.< |
This comment has been minimized.
This comment has been minimized.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of WebTorrent?
0.102.4
What browser and version? (if using WebTorrent in the browser)
Chrome
What actually happened?


I put the strategy to rarest and tried to monitor the pieces visually and came up with something that looks similar to vuzes:
It looks like many continuous pieces is in progress at the same time. Sometimes up to 200 out of 987 pieces are downloaded simultaneously. Each piece has a number of blocks and they don't get flushed until the piece is finish... Resulting in more memory being used.
That is rather unhealthy in the beginning if there is just one that started seeding something. You as a leacher won't be able to start sharing all uncompleted pieces until all blocks are downloaded, instead you request a few blocks from many pieces at the same time.
What did you expect to happen?
A better strategy would be something along:
Lbe a list of pieces in progressLand letPbe the piece you are iterating overPin his bitfield:3.1 Request the next unreserved block in that piece
3.2 If there is no more unreserved blocks left remove that piece
Pfrom the listLLand then request the next block in that piecethis will reduce the number of pieces in progress
Another idea is: if you start downloading one block from one piece don't let that peer start on another piece until all blocks in that piece are completed.
this will reduce the number of pieces in progress but not as much. but will allow you to download multiple pieces in parallell, if one peer only have one piece it would be better to just download that from him while the other gives you other pieces so you can download something from everyone