This forum has been archived. All content is frozen. Please use KDE Discuss instead.

High CPU usage when downloading

Tags: None
(comma "," separated)
lexxa
Registered Member
Posts
2
Karma
0

High CPU usage when downloading

Sat Nov 13, 2010 7:25 pm
When I try to download something in my full speed (25 megabit) I get 100% peaks in CPU usage. At the same time HDD indicator is blinking like mad. Ktorrent hangs naturally, sometimes the whole system hangs. And this continues from 2 to 30 seconds. The more simultaneous downloads, the worse it gets. When uploading only everything is normal. The problem begins to show when d/l speed is roughly more then 2 Mib/s.

Tried it with ktorrent 4.0.3 and 4.0.4. No difference. System is Kubuntu 10.10 x64, KDE 4.5.3

It does not depend on the filesystem I'm using, changed the download directory from ntfs to ext4, still get the same.
George
Moderator
Posts
5421
Karma
1

Re: High CPU usage when downloading

Sun Nov 14, 2010 9:58 am
Is µTP enabled ?
lexxa
Registered Member
Posts
2
Karma
0

Re: High CPU usage when downloading

Sun Nov 14, 2010 10:04 am
No.
Fuelx
Registered Member
Posts
1
Karma
0

Re: High CPU usage when downloading

Tue Mar 15, 2011 4:00 pm
Hello

I have the same problem.

Usually when download speeds go higher. Im on a ~100MBit line and when downloads are at 10-13 MiB/s ktorrent is extremely unresponsive, usually have to wait for 5-10 seconds before something happens in ui. And as lexxa writes, extremely high disk activity. cpu usage is around 25% at this time.

Im running ktorrent 4.0.5 archlinux
2.6.37-ARCH #1 SMP PREEMPT Tue Mar 8 08:08:06 UTC 2011 i686 Intel(R) Core(TM)2 Duo CPU E6850 @ 3.00GHz GenuineIntel GNU/Linux
7200 rpm disk.

Im using full pre allocation. utp is not enabled.
George
Moderator
Posts
5421
Karma
1

Re: High CPU usage when downloading

Tue Mar 15, 2011 6:00 pm
4.1 is just out, it would be interesting to know how it compares to 4.0.5 in this respect.

My guess is that the biggest cause, will probably be the SHA1 checking.
pravda123
Registered Member
Posts
9
Karma
0

Re: High CPU usage when downloading

Wed Aug 31, 2011 4:49 am
Еxact same problem :(

At a speed of ~90/90 MBit/s and about a 10-20 active torrents CPU usage 50-60%(1 core 100%(!), 2 - 20%). If turn off recheck chunks and utp - 30-40%. This too much. RTorrent uses 5-15%.
Memory consumption is also not small. Typically 450-650 MB. Maybe it's because of large number of torrents (~1k)?..

I like KTorrent, but his gluttony with 4.0 version makes me cry sometimes.

KTorrent 4.11, Gentoo 3.0.3, С2D E8200 @ 3.5GHz
George
Moderator
Posts
5421
Karma
1

Re: High CPU usage when downloading

Thu Sep 01, 2011 5:53 pm
pravda123 wrote:Еxact same problem :(

At a speed of ~90/90 MBit/s and about a 10-20 active torrents CPU usage 50-60%(1 core 100%(!), 2 - 20%). If turn off recheck chunks and utp - 30-40%. This too much. RTorrent uses 5-15%.
Memory consumption is also not small. Typically 450-650 MB. Maybe it's because of large number of torrents (~1k)?..

I like KTorrent, but his gluttony with 4.0 version makes me cry sometimes.

KTorrent 4.11, Gentoo 3.0.3, С2D E8200 @ 3.5GHz


I don't have that kind of connection, and usually never run 20 torrents at the same time.

It would be interesting if you could run oprofile during such a situation. It should help me pinpoint the CPU bottlenecks.
pravda123
Registered Member
Posts
9
Karma
0

Re: High CPU usage when downloading

Thu Sep 01, 2011 7:32 pm
Ok, I'll try.
I would be grateful for а short manual on the proper use oprofile.
Version 0.9.6-r1 ok, or better 0.9.7?
George
Moderator
Posts
5421
Karma
1

Re: High CPU usage when downloading

Fri Sep 02, 2011 6:11 pm
When ktorrent running and downloading with a lot of CPU usage:

sudo opcontrol --setup --no-vmlinux
sudo opcontrol --start

Let it run for several minutes

sudo opcontrol --dump
sudo opcontrol --stop

Then:

opreport -l /usr/bin/ktorrent > ktorrent.profile
opreport -l /usr/lib/libktorrent.so > libktorrent.profile

And finally send me the two profile files or post them here as attachments.
pravda123
Registered Member
Posts
9
Karma
0

Re: High CPU usage when downloading

Fri Sep 02, 2011 11:12 pm
KTorrent 4.11, Gentoo 3.0.4, С2D E8200 @ 3.56GHz
10 active torrents, 50/25 mbit/s, 20-30% of 2 core.
oprofile-0.9.7
Code: Select all
 ~ # opcontrol --setup --no-vmlinux
 ~ # opcontrol --start
Using default event: CPU_CLK_UNHALTED:100000:0:1:1
Using 2.6+ OProfile kernel interface.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
I wait 2 min, and
Code: Select all
 ~ # opcontrol --dump
 ~ # opcontrol --stop
Stopping profiling.
 ~ # opreport -l /usr/bin/ktorrent > ktorrent.profile
warning: [vdso] (tgid:8021 range:0x7fffae4d4000-0x7fffae4d5000) could not be found.
 ~ # opreport -l /usr/lib/libktorrent.so > libktorrent.profile

And profile files so small. I was worried :?
ktorrent.profile
Code: Select all
CPU: Core 2, speed 3559.91 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
samples  %        image name               symbol name
7773     70.5995  ktorrent                 /usr/bin/ktorrent
3237     29.4005  [vdso] (tgid:8021 range:0x7fffae4d4000-0x7fffae4d5000) [vdso] (tgid:8021 range:0x7fffae4d4000-0x7fffae4d5000)

libktorrent.profile
Code: Select all
CPU: Core 2, speed 3559.91 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
samples  %        symbol name
368185   100.000  /usr/lib64/libktorrent.so.3.0.1

That's all :?
George
Moderator
Posts
5421
Karma
1

Re: High CPU usage when downloading

Sun Sep 04, 2011 9:34 am
This is not very useful.

And if you let it run for longer ?
pravda123
Registered Member
Posts
9
Karma
0

Re: High CPU usage when downloading

Thu Sep 08, 2011 12:07 am
15 minutes

Code: Select all
CPU: Core 2, speed 3680.09 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
samples  %        symbol name
4095074  100.000  /usr/lib64/libktorrent.so.3.0.1
Code: Select all
CPU: Core 2, speed 3680.09 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
samples  %        image name               symbol name
102586   69.4924  ktorrent                 /usr/bin/ktorrent
45036    30.5076  [vdso] (tgid:27180 range:0x7fffebdff000-0x7fffebe00000) [vdso] (tgid:27180 range:0x7fffebdff000-0x7fffebe00000)
December
Registered Member
Posts
6
Karma
0

Re: High CPU usage when downloading

Fri Sep 09, 2011 9:06 am
Same problem here.

Fedora 15 i686 / Ktorrent 4.1.1 (from repo)

Not sure if these are at all useful, but posting in-case they are:

Code: Select all
CPU: Core 2, speed 1596 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
samples  %        image name               symbol name
32620    86.7761  [vdso] (tgid:2672 range:0x7c4000-0x7c5000) [vdso] (tgid:2672 range:0x7c4000-0x7c5000)
4971     13.2239  ktorrent                 /usr/bin/ktorrent


Code: Select all
CPU: Core 2, speed 1596 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
samples  %        symbol name
1388692  100.000  /usr/lib/libktorrent.so.3.0.1


Test ran about 10 minutes. CPU usage for Ktorrent hovered around 50 - 60% most of the time in 'top'. Downloading 7 torrents, seeding 8 - but no one was downloading those during the test period. Average up / down during test was 350 KiB/s and 90 KiB/s.

I've also noticed memory usage slowly creeps up and up, required a re-start of Ktorrent every few days. At one point it was using 2.8G of my computers 4G memory and close to 95% CPU (from 'top')!
December
Registered Member
Posts
6
Karma
0

Re: High CPU usage when downloading

Sat Sep 10, 2011 10:57 am
Image

Screengrab of top showing Ktorrent using lots of memory and CPU :-(
pravda123
Registered Member
Posts
9
Karma
0


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]