qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.21k stars 3.97k forks source link

[Windows][3.1.10] High Frequency of UI Hangs and high System load #2056

Closed Trippley closed 9 years ago

Trippley commented 10 years ago

In the last months I noticed a very high CPU load. The source of this high load seems to be qBittorrent.

I am currently using a Intel 3570k which gets peak loads of 52% CPU load with an average of 18%. This problem seems not be acquainted with the boost lib 1.56 problem as I've already switched versions and the problem still exists.

The load is split between 24% load generated by the qbittorrent.exe, 20% load generated by the System itself (only when qbittorrent runs) and 8% load generated by interrupt calls. Mostly generated when downloading with an speed higher than 400 KiB/s.

I have to say that I am a power user having over 400-600 torrents added while around 100~ are in the Seeding(but not running) state. I also have 11 active RSS Feeds and a few RSS Downloader Rules (around 40). Refreshing rate is every 15 Minutes. I have roughly 60 Tags. Reinstalling, deleting options and cache doesn't solve the problem.

I actively have problems with not responding UI since the update to 3.1.9, from there the CPU raised to very high levels. There are no differences in CPU usage and hangs even when there are 200-300 torrents more added to the complete list. The applications is marked as inactive by Windows during some high peaks.

No Events were reported in the log.

System is Windows 8.1 with the newest updates.

sledgehammer999 commented 10 years ago

Can you use my latest v3.2.0alpha build? The v3.2.x branch contains some very good optimizations for when having many torrents in the list. Also you could try increasing the transfer list refresh interval in the advanced options. Link to my latest alpha build: http://qbforums.shiki.hu/index.php/topic,2344.msg12471.html#msg12471

sorokin commented 10 years ago

@sledgehammer999 Note, for best performance perhaps you want to build with libtorrent with commit http://code.google.com/p/libtorrent/source/detail?r=10398 During active downloading it reduces a CPU time of libtorrent by 10% as discussed in http://code.google.com/p/libtorrent/issues/detail?id=683#c2.

sledgehammer999 commented 10 years ago

OK noted. Let's just wait the user try my alpha build. He should see reduced CPU usage with that too.

Trippley commented 10 years ago

@sledgehammer999 I see reduced avg CPU usage of about 8-10% but I still get the same peak loads. It seems when qBittorrent is hanging the CPU load gets higher through both the System and qBittorrent process. While the qBittorrent load is at ~24% for a while the System process load is rising.

screenshot 2014-10-20 19 51 37

System load usually looks like this while not really downloading anything.

sledgehammer999 commented 10 years ago

Hmm, I'll try to provide a new alpha build based on latest libtorrent. Stay tuned. Does ~24% mean a core is working at full(assuming 4-core system)? PS: I love how you have labeled your disks with anime character names.

Trippley commented 10 years ago

@sledgehammer999 Nope. The load is balanced on all cores. qBittorrent is running with 15 Threads.

PS: Had to do that. Downloading quite a lot of Anime.

sledgehammer999 commented 10 years ago

I did a new build. Can you test? Link: http://qbforums.shiki.hu/index.php/topic,2344.msg13403.html#msg13403

Trippley commented 10 years ago

Installed using the new alpha. Same problems accur.

After deleting RSS Downloader rules qBittorent is mostly unusable (hangs a lot more for a while)

RSS Downloader and RSS not the source of the problem.

Halving the Torrent number doesn't help. Average load lowers but peak still exists. Frequency of hangs and peak loads are reduced but this kinda happen even with only 25 Torrents. I think it could be more likely be a system specific problem as this even happens with no torrents added.

sorokin commented 10 years ago

@Trippley You have a log tab open. Do new messages appear in log regularly? If so, how many?

@sledgehammer999 I noticed, that adding message to log is very slow. On my box opening log tab takes several seconds. If new messages comes regularly (for example from libtorrent), qbittorrent will freeze.

@Trippley Could you collect a few callstacks of running qbittorrent when CPU usage is high? http://superuser.com/questions/462989/how-can-i-view-the-call-stack-of-a-running-process-thread

sledgehammer999 commented 10 years ago

@sorokin (and this may be a little offtopic) Unless, I am mistaken the log isn't used very often and it can only be used from inside qBtSession. My intention for v3.2.0 is totally refactor it. Convert it to a singleton class. Provide a generic interface for use in both gui and nox builds. Provide different backends(widget, file). And of course to be able to call from any class that wants logging functions. Mostly stop using the qDebug/qCritical macros that require you to run the program from a terminal(and debug builds of it) to get any output.

Also I am going to provide a build based on boost 1.55 as per the other bug report.

sledgehammer999 commented 10 years ago

Here is the same code but with boost 1.55: http://builds.shiki.hu/temp/qbittorrent_20141021_v3.2.0alpha_boost1.55.7z

Trippley commented 10 years ago

The newest build does best. The CPU load is still very high (even higher than before) but UI responsiveness is great and it doesn't hang. Startup time is reduced by roughly 400-500% great.

sledgehammer999 commented 10 years ago

(even higher than before)

To which build are you comparing? This one? ->http://builds.shiki.hu/qbittorrent_3.2.0alpha_20141021_ce4ef37_setup.exe

It seems that you are hitting 2 issues.

  1. The freezing issue discussed in the other thread, which is related to boost 1.56
  2. High cpu due to many torrents in the list.

If you remove the torrents(or leave very few == 10) does the cpu load stay high again? How many columns have you enabled in the transfer list? By which column do you sort?

Trippley commented 10 years ago

@sledgehammer999 I'm having a high CPU spike through qBittorrent.exe alone when qBittorrent is writing to the system (downloading) and I still get CPU spikes occasionally even though it doesn't start to hang anymore.

  1. I tested the 1.55 versions and still had freezing issues with these builds. They're not completely gone but don't appear to have a big duration anymore. qBittorrent quickly restores functionality.
  2. I just can't to seem to figure out why there should be such high spikes produced by qBittorrent and System calls at the same time between an avg. load of 6% produced by qBittorrent. These still happen.

These peaks produced by qBittorrent still happen even if only one torrent is added to the list. If no Torrents are added nothing happens. The avg. load gets very low when very few torrents are added though.

tnaden commented 10 years ago

Would just like to add that the Boost 1.55 build helped my huge freezing issues. Windows 7 64bit. Made a very sour first impression of qBittorrent with 3.1.10

sledgehammer999 commented 10 years ago

Try v3.1.11 it is using boost 1.55 too.

tnaden commented 10 years ago

It seems the update check is broken in 3.1.10... Yea. .11 seems fine.

sledgehammer999 commented 10 years ago

It seems the update check is broken in 3.1.10

http://qbforums.shiki.hu/index.php/topic,2871.msg13584.html#msg13584

tnaden commented 10 years ago

A deadly combination of issues.

Trippley commented 9 years ago

Seems like I found the issue with spiking CPU usage due to qBittorrent and the System process.

My Realtek Driver produced issues with the ndis.sys with the CALL "tryacquirenicactive" which kinda affected qBittorrent quite a lot as a lot of interrupts let qBittorrent be stalled most of the time making it impossible to use after a lot system uptime. I don't know if other persons with the Realtek RTL8168/8111 Family Gigabit Ethernet Adapter have problems with the up to date driver but I had and switched to my Intel Network Adapter were the problems ceased to exist. Restarting the network adapter solved that problem too. So most of the hangs of the gui stopped appearing switching the boost library kinda did the trick too.

The problem with the realtek adapter could be a internal kernel issue with the driver so the there could be other problems that kinda produce this problem in Windows itself while the driver isn't really the real problem. (Third party produces this problem) Only way to see this would be a reinstall which I will do when Windows 10 comes out.

CPU load with 600 Torrents is between 2% and 10,6% on a i5-3570k now. No problems anymore.

Gelmir commented 9 years ago

I have RTL8168 chip PCI\VEN_10EC&DEV_8168&SUBSYS_E0001458&REV_06\4&6F5B703&0&0048

But i have no issues using qBt on Win 8.1. I don't remember installing separate drivers, so I guess I'm using built-in Windows ones, version is 8.24.1218.2013

2014-11-12 16:44 GMT+03:00 Trippley notifications@github.com:

Seems like I found the issue with spiking CPU usage due to qBittorrent and the System process.

My Realtek Driver produced issues with the ndis.sys with the CALL "tryacquirenicactive" which kinda affected qBittorrent quite a lot as a lot of interrupts let qBittorrent be stalled most of the time making it impossible to use after a lot system uptime. I don't know if other persons with the Realtek RTL8168/8111 Family Gigabit Ethernet Adapter has problems with the up to date driver but I had and switched to my Intel Network Adapter were the problems ceased to exist. Restarting the network adapter solved that problem too. So most of the hangs of the gui stopped appearing switching the boost library kinda did the trick too.

The problem with the realtek adapter could be a internal kernel issue with the driver so the there could be other problems that kinda produce this problem in Windows itself while the driver isn't really the real problem. (Third party produces this problem) Only way to see this would be a reinstall which I will do when Windows 10 comes out.

CPU load with 600 Torrents is between 2% and 10,6% on a i5-3570k now. No problems anymore.

— Reply to this email directly or view it on GitHub https://github.com/qbittorrent/qBittorrent/issues/2056#issuecomment-62719047 .

sledgehammer999 commented 9 years ago

Unless I am mistaken the issues here are solved. Plus the v3.2.x series(current stable) contain the optimization patches for the UI. And the upcoming v3.3.x series are even more optimized.