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

svn build, couple of questions

Tags: None
(comma "," separated)
mr_w
Registered Member
Posts
5
Karma
0

svn build, couple of questions

Wed Jun 27, 2007 1:39 pm
Hi guys,

I'm using svn build for couple of months, and now I have couple of questions, as it seems that nobody else neither have these, nor at least commented on these problems.

1. CPU Slow - Fast, settings makes no difference, whatever I set, it eats up between 20-30 % CPU.

2. Memory usage - set to Low, but ktorrent process grows up to 1.9GB in size.

3. Outrageous use of getpeername(), gettimeofday(), thousands of times per second, all wasting up precious cpu cycles. I bet that there are more syscalls like that.

4. As of Fedora7 upgrade, I'm getting strange KDE window whenever ktorrent tries to move .kde/share/apps/ktorrent/log file, which waits for user inpun on whether to overwrite or suggest new name. This is somewhat annoying, as it tends to pop up when I'm in the middle of doing some other work at keyboard.

5. In relation to 4, there is no obvious way to disable logging. Am I correct on that ?



In overall, after running ktorrent for a day (approximately) it eats up so many resources, that desktop becomes unusable.

Few things about my system: It is AMD64, 1GB ram, total of 600GB storage on 1 ATA and 2SATA disks, ext2 and fat32 filesystems. Distro is Fedora 7 - (it was FC6 until recently).

There are about 20+ torrents downloading at any time, up/down link is 512k, but limited to 32kb dn/ 5kb up in ktorrent settings.


So, if anyone is willing to provide some input on these issues, it would be very good to know if these are going to be addressed, or should I get my hands dirty, and do some constructive butchering of code :D

Greetings,
Vladimir
George
Moderator
Posts
5421
Karma
1

Re: svn build, couple of questions

Wed Jun 27, 2007 5:33 pm
mr_w wrote:Hi guys,

I'm using svn build for couple of months, and now I have couple of questions, as it seems that nobody else neither have these, nor at least commented on these problems.

1. CPU Slow - Fast, settings makes no difference, whatever I set, it eats up between 20-30 % CPU.


This is only used when upload or download limits are set. Anyway, you have to remember the more torrents you run, the more CPU will be used.

2. Memory usage - set to Low, but ktorrent process grows up to 1.9GB in size.


As far as we know there are no memory leaks, so this should not happen I will keep an eye on the memory usage.

3. Outrageous use of getpeername(), gettimeofday(), thousands of times per second, all wasting up precious cpu cycles. I bet that there are more syscalls like that.


getpeername shouldn't happen much. There is actually only one call to getpeername in the code, so caching this is not much effort.

As for gettimeofday, that is cached to a certain degree, but it is still used a lot because we need accurate timing for speed limits.
Though looking through the code, there are some places where we can still get rid of them by using the cached time.


4. As of Fedora7 upgrade, I'm getting strange KDE window whenever ktorrent tries to move .kde/share/apps/ktorrent/log file, which waits for user inpun on whether to overwrite or suggest new name. This is somewhat annoying, as it tends to pop up when I'm in the middle of doing some other work at keyboard.


This should not happen in a recent svn version, the log rotate automatically overwrites files. So unless there is some sort of global option which overrides the parameters we pass to KIO::file_move, this should not happen.

5. In relation to 4, there is no obvious way to disable logging. Am I correct on that ?


No
mr_w
Registered Member
Posts
5
Karma
0

Wed Jun 27, 2007 6:10 pm
Just a quick note - current memory usage:

Code: Select all
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
20649 taja      34  19 2043m 421m   9m R 28.2 42.1 542:08.82 ktorrent


Also, for gettimeofday(), I've made quick hack, to call gettimeofday() at every 500th call of Now().
I still get around 4000 gettimeofday()'s per SECOND.

The KT_PROFILE doesn't seems to be enabled, so most probably this is not comming from profiler.
mr_w
Registered Member
Posts
5
Karma
0

Wed Jun 27, 2007 6:15 pm
But note please that this doesn't mean that there would be 2.000.000 calls of gettimeofday() per second :) It just means that ktorrent is hammering it as fast as possible.
George
Moderator
Posts
5421
Karma
1

Wed Jun 27, 2007 6:22 pm
I have replaced several calls to Now by GetCurrentTIme, which uses a cached value which gets updated only a couple of a times per second.

Anyway the bulk of these calls is probably in the networking threads and they need to have accurate timing. So they can be called a lot.

The question is, is this really a problem ? I guess it's time to start profiling this.

Concerning the memory usage, what kind of stuff are you running ? What plugins ? Is DHT enabled ?
mr_w
Registered Member
Posts
5
Karma
0

Wed Jun 27, 2007 7:31 pm
Only file info plugin, and DHT is disabled.

On the topic of networking stuff that needs accurate timing, I will have to take a closer look at how it is implemented, as I'm sure that I/O limits can be implemented in resource friendly manner. In fact, I've done that before, in commercial product that I'm working on, we have anything between 7000 - 10000 open connections, with I/O limiting, and I/O going up to 100Mbps.. but processes actually have time to do something usefull beside of limiting output :)

So I will take a look as soon as I'm near my home computer.
mr_w
Registered Member
Posts
5
Karma
0

Sun Jul 01, 2007 1:20 am
Hi,

we kinda solved memory issue by adding 2GB more RAM in our desktop :)

However, the cpu utilization is still the same, in 20-30% range.


Bookmarks



Who is online

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