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

100% CPU use with many torrents announcing to a tracker with an expired certificate #15623

Open
ivan opened this issue Oct 24, 2021 · 5 comments
Labels
Can't reproduce Issues that cannot be reproduced Libtorrent Performance

Comments

@ivan
Copy link

ivan commented Oct 24, 2021

qBittorrent & operating system versions

qBittorrent: 4.3.8 x64
Operating system: NixOS 21.11-pre, NixOS 21.05
Qt: 5.15.2
libtorrent-rasterbar: 2.0.3, 2.0.4, or arvidn/libtorrent@69cb589

Specifically, I confirmed this issue and saw the same behavior with:

  • (x86_64 NixOS) qbittorrent 4.3.8 with libtorrent arvidn/libtorrent@69cb589
  • (x86_64 NixOS) qbittorrent 4.3.8 with libtorrent 2.0.4
  • (x86_64 NixOS) qbittorrent 4.3.5 with libtorrent 2.0.3

What is the problem?

qBittorrent/libtorrent seems to use 100% CPU (one core) when it has many torrents announcing to a tracker with an expired HTTPS certificate.

There isn't really any visible indication or logging that indicates the problem, I just lucked into figuring it out.

Steps to reproduce

  1. Try to download a few hundred torrents pointing to an https:// tracker with an expired certificate
  2. Make sure 'Validate HTTP tracker certificates' is enabled (the default)
  3. Observe 100% CPU use of one core, never decreasing, and strace showing one of the qbittorrent threads spinning fast on epoll_wait(15, [], 128, 0) = 0
  4. Disable 'Validate HTTP tracker certificates'
  5. Wait a few minutes and observe low CPU use
  6. Repeat to confirm if desired (enable validation, force reannounce), it should always reproduce

Additional context

with 'Validate HTTP tracker certificates':

with validation Screenshot 2021-10-24 215727

without 'Validate HTTP tracker certificates':

without validation Screenshot 2021-10-24 215649

Log(s) & preferences file(s)

No response

@Chocobo1
Copy link
Member

Nice find! you should also report this problem upstream: https://github.com/arvidn/libtorrent/issues

@ghost
Copy link

ghost commented Oct 25, 2021

@arvidn

@ghost
Copy link

ghost commented Jul 17, 2022

I could not reproduce it. I tested with 1000 torrents with 7-8 trackers that had expired certificates.
Tested on windows 10 x64 with qbt 4.4.3.1, libtorrent 2.0.6 and 1.2.16.
OpenSSL: 1.1.1o

@ghost ghost added the Can't reproduce Issues that cannot be reproduced label Jul 17, 2022
@arvidn
Copy link
Contributor

arvidn commented Jul 17, 2022

there was an issue related to HTTP tracker DNS lookups that, if they took too long, could trigger a 100% CPU busy loop. It was fixed in the recently released libtorrent 1.2.17 and 2.0.7

@ghost
Copy link

ghost commented Jul 17, 2022

I’m not sure if they’re the same issue but this ticket indicates that turning off https tracker validation fixed it for OP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can't reproduce Issues that cannot be reproduced Libtorrent Performance
Projects
None yet
Development

No branches or pull requests

4 participants