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

extremely high cpu usage when adding a torrent #122

Closed
feross opened this issue Sep 21, 2014 · 4 comments
Closed

extremely high cpu usage when adding a torrent #122

feross opened this issue Sep 21, 2014 · 4 comments
Labels

Comments

@feross
Copy link
Member

@feross feross commented Sep 21, 2014

Issue by vikstrous
Tuesday Jun 10, 2014 at 05:49 GMT
Originally opened as https://github.com/feross/bittorrent-client/issues/26


Whenever I add a torrent (from a content hash) I get extremely high cpu usage for a while until it stops and streaming starts. It seems to have something to do with sha1 hashes and verifying pieces. This didn't happen in version 0.1.1. Has anyone else experienced this? If not, I'll try to get more details.

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Sep 21, 2014

Comment by feross
Tuesday Jun 10, 2014 at 06:10 GMT


I've noticed this as well. I suspect it is caused by the code for verifying
incomplete pieces at startup (for resumable downloads). Unless the storage
is backed by disk (which vanilla bittorrent-client is not), we shouldn't
run this code.

Of course, this is only a guess.

On Monday, June 9, 2014, Viktor Stanchev notifications@github.com wrote:

Whenever I add a torrent (from a content hash) I get extremely high cpu
usage for a while until it stops and streaming starts. It seems to have
something to do with sha1 hashes and verifying pieces. This didn't happen
in version 0.1.1. Has anyone else experienced this? If not, I'll try to get
more details.


Reply to this email directly or view it on GitHub
https://github.com/feross/bittorrent-client/issues/26.

Feross | blog http://feross.org/ | webtorrent http://webtorrent.io/ |
studynotes http://www.apstudynotes.org/

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Sep 21, 2014

Comment by vikstrous
Tuesday Jun 10, 2014 at 14:43 GMT


I confirmed that it's caused by https://github.com/feross/bittorrent-client/blob/master/lib/torrent.js#L560

However, setting {verify: false} in the BitTorrentClient constructor doesn't seem to bypass this verification.

@feross feross added the bug label Sep 21, 2014
@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Sep 21, 2014

Comment by fisch0920
Thursday Jun 12, 2014 at 01:50 GMT


Hmm, the verification code for non fs-storage should run in no time since all reads are shortcuts, but clearly there's an issue with the implementation.

@feross feross removed the bug label Oct 25, 2014
@feross feross added the help wanted label Nov 19, 2014
@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Mar 12, 2015

Closing out old issues. Feel free to comment or open a new issue if this still affects you.

@feross feross closed this Mar 12, 2015
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.