Skip to content
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

'sequential' piece selection should be a better citizen #375

Open
feross opened this issue Jul 16, 2015 · 2 comments
Open

'sequential' piece selection should be a better citizen #375

feross opened this issue Jul 16, 2015 · 2 comments

Comments

@feross
Copy link
Member

feross commented Jul 16, 2015

Right now we have two strategies: 'sequential' or 'rarest'. 'sequential' is the default.

To be a good citizen, we should switch to the 'rarest' piece selection strategy if there's no critical need for certain pieces, i.e. if there's enough buffer while streaming, we can switch to the normal bittorrent selection strategy until the buffer is low again.

In addition to being the right thing to do, this is actually essential for web peers to work correctly. If both web and hybrid peers are only fetching sequentially, then web peers will keep getting disconnected from torrents where there are no hybrid peers that are seeding. Hybrid peers that are still downloading won't want to peer with a web peer that only leeches from it and offers no unique pieces.

@ghost
Copy link

ghost commented Jul 23, 2015

I wonder how this correlates with "Seamlessly switches between sequential and rarest-first piece selection strategy" part in the README.md?

@feross
Copy link
Member Author

feross commented Jul 24, 2015

I actually re-read the actual code recently and noticed that the seamless switching code is missing, so I created this issue. I can't remember if I never implemented it, or it never got committed for some reason.

In any case, this whole part of the codebase needs a refactor, which I plan to do soon. I want to share this "strategy" code with torrent-stream/peerflix so we can combine our efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant