Bug 145370

Summary: Ktorrent consumes 86.5% of the CPU
Product: ktorrent Reporter: Alejandro Diaz Caro <janus>
Component: generalAssignee: Joris Guisson <joris.guisson>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: top command where you can see ktorrent consuming 78.8% of CPU load

Description Alejandro Diaz Caro 2007-05-13 05:20:49 UTC
Version:           2.1.4 (using KDE 3.5.6, Kubuntu (feisty) 4:3.5.6-0ubuntu14)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.20-15-generic

Ktorrent consumes between 78% and 95% of CPU load. It's normal? I have a 2GHz CPU with 1Gb of RAM.
Comment 1 Joris Guisson 2007-05-15 19:28:19 UTC
Euhm, that seems a bit much ? Does it improve if you set no download limits ?
Comment 2 Alejandro Diaz Caro 2007-05-15 20:08:56 UTC
No, I normally don't set any download limits.
Comment 3 Joris Guisson 2007-05-15 20:16:53 UTC
I mean download and upload limits ? Just set no limits at all and see what the CPU usage is.
Comment 4 Alejandro Diaz Caro 2007-05-15 20:35:59 UTC
Yes, I understood, I set no limits at all, and the CPU usage (after a few minuts) is near 90%
Comment 5 Alejandro Diaz Caro 2007-05-15 20:45:26 UTC
I am trying this right now. And I don't know why, but now ktorrent consumes "only" 45% of the CPU (ok, is still too much, but isn't 90%)
Comment 6 Joris Guisson 2007-05-17 10:04:50 UTC
How fast are you actually downloading ? 

Comment 7 Alejandro Diaz Caro 2007-05-17 14:41:34 UTC
200~250 kb/s in average, but that depends on what so popular is torrent.
Comment 8 Joris Guisson 2007-05-17 19:19:42 UTC
A lot of CPU usage, for those speeds.
Comment 9 Alejandro Diaz Caro 2007-05-17 19:30:13 UTC
Yes, I know.
Right now, I am downloading Ubuntu Feisty DVD at 188.3 kB/s in average with a CPU usage of 25% by Ktorrent.
Comment 10 Alejandro Diaz Caro 2007-05-17 22:00:49 UTC
Created attachment 20618 [details]
top command where you can see ktorrent consuming 78.8% of CPU load

Here, I was downloading 2 files, one of 3.97Gb at 199 kB/s and the other one of
350.1Mb at 35 kB/s
Comment 11 Joris Guisson 2007-05-18 19:02:28 UTC
SVN commit 666055 by guisson:

Make network thread sleeptime configurable upto 50 ms.

BUG: 145370



 M  +1 -1      apps/ktorrent/advancedpref.ui  
 M  +2 -2      libktorrent/ktorrent.kcfg  


--- trunk/extragear/network/ktorrent/apps/ktorrent/advancedpref.ui #666054:666055
@@ -322,7 +322,7 @@
                                 <number>1</number>
                             </property>
                             <property name="maxValue">
-                                <number>10</number>
+                                <number>50</number>
                             </property>
                             <property name="value">
                                 <number>3</number>
--- trunk/extragear/network/ktorrent/libktorrent/ktorrent.kcfg #666054:666055
@@ -203,9 +203,9 @@
 		</entry>
 		
 		<entry name="cpuUsage" type="Int">
-			<default>3</default>
+			<default>25</default>
 			<min>1</min>
-			<max>10</max>
+			<max>50</max>
 		</entry>
 		
 		<entry name="minDiskSpace" type="Int">
Comment 12 Alejandro Diaz Caro 2007-05-18 19:16:09 UTC
Thanks!