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

CPU Usage issue.

Tags: None
(comma "," separated)
George
Moderator
Posts
5421
Karma
1

Sun Jul 02, 2006 5:21 pm
I can't reproduce it here, and it seems anonsvn is up to date (so not those high load problems)
snap
Registered Member
Posts
20
Karma
0

Sun Jul 02, 2006 6:28 pm
I tried it with the last weekly snpashot too and found the same problems.

strace showed me, that ktorrent made a lot of ioctl and select kernel calls while the 99% phases (more then 70%).

I try it with anonsvn after the new build is finished an will post what happened there (with more detailed logs).
snap
Registered Member
Posts
20
Karma
0

Sun Jul 02, 2006 6:58 pm
the problem still exists (but not that heavy) with the latest svn snapshot i could get.

CPU: Opteron 64Bit long mode running

here are the summaries from strace:

ktorrent working fine:

Process 21899 detached
Process 21925 detached
Process 21926 detached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
71.75 0.050217 1 52482 select
22.87 0.016008 6 2585 write
3.85 0.002691 0 182163 ioctl
0.42 0.000295 2 126 126 connect
0.31 0.000217 0 61692 4 sendto
0.28 0.000195 0 1329 39 read
0.25 0.000175 2 80 getpeername
0.19 0.000135 1 144 close
0.07 0.000051 0 3662 recvfrom
0.00 0.000000 0 54 open
0.00 0.000000 0 3321 3321 stat
0.00 0.000000 0 128 fstat
0.00 0.000000 0 1200 1200 lstat
0.00 0.000000 0 277 poll
0.00 0.000000 0 12 lseek
0.00 0.000000 0 165 mmap
0.00 0.000000 0 8 mprotect
0.00 0.000000 0 163 munmap
0.00 0.000000 0 6 brk
0.00 0.000000 0 29 rt_sigprocmask
0.00 0.000000 0 29 29 rt_sigreturn
0.00 0.000000 0 10 writev
0.00 0.000000 0 86 80 access
0.00 0.000000 0 1321 nanosleep
0.00 0.000000 0 126 socket
0.00 0.000000 0 26 accept
0.00 0.000000 0 26 setsockopt
0.00 0.000000 0 77 getsockopt
0.00 0.000000 0 29 kill
0.00 0.000000 0 304 fcntl
0.00 0.000000 0 75 getppid
0.00 0.000000 0 29 29 rt_sigsuspend
0.00 0.000000 0 1 restart_syscall
------ ----------- ----------- --------- --------- ----------------
100.00 0.069984 311765 4828 total

ktorrent 99% cpu usage:

Process 21899 detached
Process 21925 detached
Process 21926 detached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
69.55 0.110266 1 187156 select
22.81 0.036158 0 601563 ioctl
7.09 0.011246 0 204472 4 sendto
0.19 0.000298 2 180 5 close
0.14 0.000223 2 110 110 connect
0.09 0.000139 0 1304 recvfrom
0.08 0.000130 0 1352 1 write
0.05 0.000079 2 38 munmap
0.00 0.000000 0 300 read
0.00 0.000000 0 5 open
0.00 0.000000 0 858 858 stat
0.00 0.000000 0 6 fstat
0.00 0.000000 0 312 312 lstat
0.00 0.000000 0 658 poll
0.00 0.000000 0 1 lseek
0.00 0.000000 0 36 mmap
0.00 0.000000 0 1 brk
0.00 0.000000 0 165 rt_sigprocmask
0.00 0.000000 0 165 165 rt_sigreturn
0.00 0.000000 0 8 writev
0.00 0.000000 0 97 nanosleep
0.00 0.000000 0 110 socket
0.00 0.000000 0 15 accept
0.00 0.000000 0 47 getpeername
0.00 0.000000 0 15 setsockopt
0.00 0.000000 0 64 getsockopt
0.00 0.000000 0 165 kill
0.00 0.000000 0 250 fcntl
0.00 0.000000 0 20 getppid
0.00 0.000000 0 165 165 rt_sigsuspend
0.00 0.000000 0 1 restart_syscall
------ ----------- ----------- --------- --------- ----------------
100.00 0.158539 999639 1620 total

i made also 2 logs from similar situations, but they are much to long to post here. If you want i can send them you per mail.

hope that helps.

(and thanks for that fine torrent downloader, i love it)
cyrylas
Registered Member
Posts
59
Karma
0

Sun Jul 02, 2006 10:29 pm
I have high CPU consumption too with the latest SVN.

- DHT enabled
- Use Protocol encryption selected
- Allow Unencrypted connections deselected

What is more, i just get ktorrent crash (unusable unfortunelly):
Using host libthread_db library "/lib/i686/libthread_db.so.1".
`shared object read from target memory' has disappeared; keeping its symbols.
0xb6833006 in nanosleep () from /lib/i686/libc.so.6
#0 0xb6833006 in nanosleep () from /lib/i686/libc.so.6
#1 0x00000000 in ?? ()
but ktorrent still is in the memory consuming all the CPU.
LinuxDoc
Registered Member
Posts
9
Karma
0

Sun Jul 02, 2006 10:40 pm
Code: Select all
strace -c -f  ktorrent
execve("/usr/bin/ktorrent", ["ktorrent"], [/* 59 vars */]) = 0
Process 27968 attached
Process 28069 attached
Process 28070 attached
Process 27968 detached
Process 28070 detached
Process 28069 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 45.70    0.727421           2    295595           ioctl
  8.57    0.136399          31      4393           select
  8.55    0.136124          68      2011           write
  4.82    0.076683           7     11305           fstat64
  4.79    0.076204          15      5082       104 read
  4.51    0.071743           8      9097           gettimeofday
  3.84    0.061087          24      2592       674 open
  3.17    0.050416          11      4718       452 stat64
  2.52    0.040115          20      2008           close
  2.12    0.033781         176       192           unlink
  1.99    0.031667          13      2440      1370 access
  1.47    0.023367          14      1661           munmap
  1.38    0.022000          31       707           fcntl64
  1.17    0.018602          10      1776           mmap2
  0.98    0.015618           6      2641           brk
  0.90    0.014326         163        88           getsockname
  0.46    0.007352        1838         4           fdatasync
  0.38    0.006077          14       429        60 lstat64
  0.33    0.005216          59        88           accept
  0.27    0.004359           8       514           lseek
  0.27    0.004319           7       581           time
  0.25    0.004009          40        99           bind
  0.24    0.003792         211        18           writev
  0.16    0.002499          45        56           getdents64
  0.14    0.002237           6       370        86 _llseek
  0.11    0.001823          12       153           old_mmap
  0.09    0.001472          15        98           rt_sigaction
  0.09    0.001464           3       468           nanosleep
  0.09    0.001371           7       187         1 send
  0.06    0.001010          14        72           readlink
  0.06    0.000999         167         6         1 connect
  0.06    0.000911          19        48           uname
  0.06    0.000896           8       106         1 socket
  0.04    0.000692           6       113           fchmod
  0.04    0.000578           6        99           getppid
  0.03    0.000523           5       105           fchown32
  0.03    0.000429          11        39           getpid
  0.03    0.000420         210         2         2 rt_sigsuspend
  0.03    0.000413           4       103        97 setsockopt
  0.03    0.000400           2       210           umask
  0.02    0.000386           6        66           recv
  0.02    0.000345          19        18           readv
  0.02    0.000330           3        98           listen
  0.02    0.000304         304         1           fork
  0.02    0.000304          76         4           rename
  0.02    0.000297           2       124           getuid32
  0.02    0.000274           2       110           getgid32
  0.01    0.000169           3        52           rt_sigprocmask
  0.01    0.000102           1        99         1 poll
  0.01    0.000098          25         4           link
  0.00    0.000060          30         2         1 waitpid
  0.00    0.000049          12         4           pipe
  0.00    0.000037          37         1           madvise
  0.00    0.000034           5         7         2 getpeername
  0.00    0.000025           8         3           getsockopt
  0.00    0.000024          12         2           shmdt
  0.00    0.000023          12         2           shmat
  0.00    0.000021          21         1           sendto
  0.00    0.000021          21         1           recvmsg
  0.00    0.000020           5         4           geteuid32
  0.00    0.000018           6         3           kill
  0.00    0.000018           9         2           clone
  0.00    0.000017           9         2           getcwd
  0.00    0.000016           8         2           shmget
  0.00    0.000010           3         3           set_thread_area
  0.00    0.000008           8         1           _sysctl
  0.00    0.000008           4         2           getrlimit
  0.00    0.000006           6         1           recvfrom
  0.00    0.000005           5         1         1 sigreturn
  0.00    0.000005           5         1           getegid32
  0.00    0.000005           3         2           shmctl
  0.00    0.000003           3         1           mprotect
  0.00    0.000002           2         1           sched_getparam
  0.00    0.000002           2         1           sched_setscheduler
  0.00    0.000002           2         1           sched_getscheduler
  0.00    0.000001           1         1           sched_yield
------ ----------- ----------- --------- --------- ----------------
100.00    1.591863                350902      2853 total


with the latest svn (from now) ... I dont know if it helps .. using gcc 3.3.1 and qt 3.3.5 , kde3.5.2 running pclinuxos (mandriva based).

At the moment of 99% CPU :
Code: Select all
30975 select(337, [95 117 118 119 120 150 164 268 271 276 300 303 307 311 312 314 316 317 321 322 324 325 329 330 331 332 333 336], [], NULL, {0, 50000}) = 16 (in [95 117 150 164 300 303 307 311 321 322 324 325 329 330 331 333], left {0, 50000})
30975 gettimeofday({1151881693, 745210}, NULL) = 0
30975 ioctl(95, FIONREAD, [0])          = 0
30975 ioctl(117, FIONREAD, [0])         = 0
30975 ioctl(164, FIONREAD, [0])         = 0
30975 ioctl(322, FIONREAD, [0])         = 0
30975 ioctl(325, FIONREAD, [0])         = 0
30975 ioctl(331, FIONREAD, [0])         = 0
30975 ioctl(333, FIONREAD, [0])         = 0
30975 ioctl(300, FIONREAD, [0])         = 0
30975 ioctl(311, FIONREAD, [0])         = 0
30975 ioctl(324, FIONREAD, [0])         = 0
30975 ioctl(303, FIONREAD, [0])         = 0
30975 ioctl(329, FIONREAD, [0])         = 0
30975 ioctl(307, FIONREAD, [0])         = 0
30975 ioctl(150, FIONREAD, [0])         = 0
30975 ioctl(330, FIONREAD, [0])         = 0
30975 ioctl(321, FIONREAD, [0])         = 0
30975 ioctl(95, FIONREAD, [0])          = 0
30975 ioctl(117, FIONREAD, [0])         = 0
30975 ioctl(164, FIONREAD, [0])         = 0
30975 ioctl(322, FIONREAD, [0])         = 0
30975 ioctl(325, FIONREAD, [0])         = 0
30975 ioctl(331, FIONREAD, [0])         = 0
30975 ioctl(333, FIONREAD, [0])         = 0
30975 ioctl(300, FIONREAD, [0])         = 0
30975 ioctl(311, FIONREAD, [0])         = 0
30975 ioctl(324, FIONREAD, [0])         = 0
30975 ioctl(303, FIONREAD, [0])         = 0
30975 ioctl(329, FIONREAD, [0])         = 0
30975 ioctl(307, FIONREAD, [0])         = 0
30975 ioctl(150, FIONREAD, [0])         = 0
30975 ioctl(330, FIONREAD, [0])         = 0
30975 ioctl(321, FIONREAD, [0])         = 0
30975 select(337, [95 117 118 119 120 150 164 268 271 276 300 303 307 311 312 314 316 317 321 322 324 325 329 330 331 332 333 336], [], NULL, {0, 50000}) = 16 (in [95 117 150 164 300 303 307 311 321 322 324 325 329 330 331 333], left {0, 50000})
30975 gettimeofday({1151881693, 746044}, NULL) = 0
30975 ioctl(95, FIONREAD, [0])          = 0
30975 ioctl(117, FIONREAD, [0])         = 0
30975 ioctl(164, FIONREAD, [0])         = 0
30975 ioctl(322, FIONREAD, [0])         = 0
30975 ioctl(325, FIONREAD, [0])         = 0
30975 ioctl(331, FIONREAD, [0])         = 0
30975 ioctl(333, FIONREAD, [0])         = 0
30975 ioctl(300, FIONREAD, [0])         = 0
30975 ioctl(311, FIONREAD, [0])         = 0
30975 ioctl(324, FIONREAD, [0])         = 0
30975 ioctl(303, FIONREAD, [0])         = 0
30975 ioctl(329, FIONREAD, [0])         = 0
30975 ioctl(307, FIONREAD, [0])         = 0
30975 ioctl(150, FIONREAD, [0])         = 0
30975 ioctl(330, FIONREAD, [0])         = 0
30975 ioctl(321, FIONREAD, [0])         = 0
30975 ioctl(95, FIONREAD, [0])          = 0
30975 ioctl(117, FIONREAD, [0])         = 0
30975 ioctl(164, FIONREAD, [0])         = 0
30975 ioctl(322, FIONREAD, [0])         = 0
30975 ioctl(325, FIONREAD, [0])         = 0
30975 ioctl(331, FIONREAD, [0])         = 0
30975 ioctl(333, FIONREAD, [0])         = 0
30975 ioctl(300, FIONREAD, [0])         = 0
30975 ioctl(311, FIONREAD, [0])         = 0
30975 ioctl(324, FIONREAD, [0])         = 0
30975 ioctl(303, FIONREAD, [0])         = 0
30975 ioctl(329, FIONREAD, [0])         = 0
30975 ioctl(307, FIONREAD, [0])         = 0
30975 ioctl(150, FIONREAD, [0])         = 0
30975 ioctl(330, FIONREAD, [0])         = 0
30975 ioctl(321, FIONREAD, [0])         = 0


here is a strace log http://www.0bock.info/ktorrent-strace.log ~3.5MB
George
Moderator
Posts
5421
Karma
1

Mon Jul 03, 2006 4:46 pm
OK, it seems that DHT and lots of connection attempts cause this. Encryption isn't necessary.
George
Moderator
Posts
5421
Karma
1

Wed Jul 05, 2006 4:27 pm
I have a solution, but still need to test a fix for a different bug. So I will commit tomorrow.
LinuxDoc
Registered Member
Posts
9
Karma
0

Thu Jul 06, 2006 9:37 am
EDIT:

the bug still exist

The problem i tryed with a clean install, because my Harddrive (samsung 1614N) crashed 2 days ago (hardware error ... klack klack klack ).

With only 2 torrents it was ok, but with more torrents the CPU rise up....

Last edited by LinuxDoc on Thu Jul 06, 2006 11:06 pm, edited 2 times in total.
stoeptegel
Registered Member
Posts
1075
Karma
0

Thu Jul 06, 2006 10:02 am
Am i missing a commit here? (a fix while there's no commit)
George
Moderator
Posts
5421
Karma
1

Thu Jul 06, 2006 10:06 am
LinuxDoc wrote:Now I think you have it done :-)

At the moment the CPU is back to normal, great.

Now i think I must do a donation !

Thanks for the great ktorrent, the best linux bittorrent client.


Euhm it's not committed yet ...

EDIT: now it is committed
LinuxDoc
Registered Member
Posts
9
Karma
0

Fri Jul 07, 2006 12:25 am
But now it works :-)

Thanks
snap
Registered Member
Posts
20
Karma
0

Fri Jul 07, 2006 7:25 am
LinuxDoc wrote:But now it works :-)

Thanks

was there a commit which fixed the bug? *wants to make a update to*

edit: tested newest version, 99% workload is gone for me
stoanhart
Registered Member
Posts
1
Karma
0

Fri Jul 14, 2006 3:37 am
I just got this bug too, and came here to post about it. Aparantly it's a well known issue. However, there seems to be no mention of a possible related memory leak:

Image

This is with one torrent seeding.

Encryption is ON as my ISP throttles. If there is any other info you need, just replay, I have auto-notify on.

edit: I should probably point out I'm not using the SVN version, but the beta. Maybe this has already been fixed.
George
Moderator
Posts
5421
Karma
1

Fri Jul 14, 2006 7:45 am
I haven't heard any complaint about memory leaks with the latest SVN versions.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot]