aMule Forum

English => aMule Help => Topic started by: snicker on November 03, 2004, 11:53:46 PM

Title: high cpu usage since rc4
Post by: snicker on November 03, 2004, 11:53:46 PM
Hi folks,
I've been using aMule for a while now. But there is one thing that bugs me a lot: since I started using it, cpu usage is at about 30-60%, which is completely incomprehensible for me. actually it is almost unacceptable.   sometimes I can't even use my computer, because all the resources are being drained.
Maybe it is my fault and I'm doing something wrong...
... can you give me tips about how to mend this problem ?
Perhaps some preferences I can change?
Or is it because I have too many downloads at the time?
I don't know... I thought rc6-7 would have this solved, but all stayed the same...
By the way: this is not a hashing problem, cpu usage is constantly up...

I'm running Debian usntable on an AMD 2400 (2Ghz clock: 700 just for aMule!!).

Thanks a lot in advance!!!
Title: Re: high cpu usage since rc4
Post by: Jacobo221 on November 04, 2004, 10:52:26 PM
Are you on wxWidgets 2.4 ?
Title: Re: high cpu usage since rc4
Post by: snicker on November 05, 2004, 02:19:28 AM
how do I find that out???
I just did an 'apt-get install amule' on debian unstable....
Title: Re: high cpu usage since rc4
Post by: deltaHF on November 05, 2004, 04:01:12 AM
ls -l /usr/bin/wx*

ls -l /usr/local/bin/wx*
Title: Re: high cpu usage since rc4
Post by: snicker on November 05, 2004, 06:11:57 AM
$ ls -l /usr/bin/wx*
-rwxr-xr-x  1 root root 342440 2004-10-19 19:29 /usr/bin/wxcas
lrwxrwxrwx  1 root root      3 2004-10-26 13:58 /usr/bin/wxvlc -> vlc

$ ls -l /usr/local/bin/wx*
ls: /usr/local/bin/wx*: not found

guess I have... right? so, now what?
Title: Re: high cpu usage since rc4
Post by: Jacobo221 on November 05, 2004, 11:32:20 AM
uh... you didn't compile it, didn't you? you installed from rom maybe?
If so, use wx rpms here at amule.org The wx rpms provided by distros a BROKEN (and they know, but they don't mind fixing them) and take HUGE amounts of CPU and frequent crashes.
Greetings!
Title: Re: high cpu usage since rc4
Post by: snicker on November 05, 2004, 11:41:39 AM
no I didn't compile. I installed the '.deb' from debian repositories.
so what should I do:
- compile myself [in this case: with or without wx? how would I do that (I mean, enable or disable wx)?]
- get an rpm and install even though I'm in Debian (don't even know how to do that! or if is is 'legal'...)

by the way, thanks to all the help you've been giving me!

oh, another thing:
"The wx rpms provided by distros a BROKEN (and they know, but they don't mind fixing them) "
is this really true for debian packages??? is there a way to verify that? who is responsible for that!?
it doesn't seem like a good practice...
Title: Re: high cpu usage since rc4
Post by: GonoszTopi on November 05, 2004, 12:51:25 PM
The best way is to download wxWidgets-2.5.3 from http://wxwidgets.org and compile/install it yourself. (Note: do not compile with unicode if you plan to use the webserver, it's now broken for unicode builds).

After this is finished, download amule (CVS, or rc7 if you really don't like CVS) source and compile it for yourself. (use configure with --disable-optimize --enable-debug ...etc what you like -- configure --help gives a full list of switches)

This should fix your problem, my aMule here uses about 6-9% of CPU
Title: Re: high cpu usage since rc4
Post by: snicker on November 05, 2004, 05:06:27 PM
ok, so I downloaded:
-wxGTK-2.4.2 (here: http://download.berlios.de/amule/wxGTK-2.4.2.tar.gz)
-wxBase-2.4.2 (here: http://download.berlios.de/amule/wxBase-2.4.2.tar.gz)
then, did a:
$ apt-get install libgtk1.2-dev libcurl2-dev
(required to install sources in debian)
installed the wx (see http://www.amule.org/wiki/index.php/HowTo_Compile_In_Debian), everything went ok.
got aMule from CVS:
$ cvs -d:pserver:anonymous@cvs.amule.berlios.de:/cvsroot/amule login
(press enter when prompted for password, took me a while to figure that one out!!)
$ cvs -z3 -d:pserver:anonymous@cvs.amule.berlios.de:/cvsroot/amule co amule-cvs

then I:
$ ./autogen.sh
and then:
$ ./configure --enable-debug --enable-optimise --prefix=/usr
and, finally:
$ make

and I got:

gcc  -Wall -g -ggdb -fno-inline -D__DEBUG__ -g -O2    -o cas  cas.o  -L/usr/lib -lcurl -lssl -lcrypto -ldl -lssl -lcrypto -ldl -lz -lcryptopp
/usr/bin/ld: cannot find -lcryptopp
collect2: ld returned 1 exit status
make[2]: ** [cas] Erro 1
make[2]: Leaving directory `/home/rhwinter/compactados/aMule/amule-cvs/src'
make[1]: ** [all-recursive] Erro 1
make[1]: Leaving directory `/home/rhwinter/compactados/aMule/amule-cvs'
make: ** [all] Erro 2

which made me realise this is not the correct CVS.... wonder where it is at...
got a tarball here:
http://amule.hirnriss.net/
(today's version! 05/11/04)

$ tar -xjvf aMule.(etc).tar.bz2
$ ./configure --enable-debug --enable-optimise --prefix=/usr
$ make && make install
(make gave me A LOT of warnings, guess that is normal...)

and now, cpu usage is the same !!! :(
I even tried with the "disable-optimise" flag you mentioned, but all stayed the same...
well... maybe it did go down a bit, but still ~30-40% is too much, isn't it?!?
GonoszTopi, how many downloads do you have?
is that what influences, maybe?
Title: Re: high cpu usage since rc4
Post by: snicker on November 05, 2004, 05:14:08 PM
and oh.... searching is not working on the cvs version...
(at least I hope that is the problem, if it is wx instead, then I'll just go and kill myself right away)
so, back to:
$ apt-get remove amule
$ apt-get install amule
Title: Re: high cpu usage since rc4
Post by: GonoszTopi on November 06, 2004, 11:19:58 AM
Install wxWidgets 2.5.3 instead of 2.4.2. There are many chenges in wx since 2.4.2, and a lot regarding performance.

(The only thing known to not work is the webserver, but only with gtk2 and unicode enabled build)

You will also have to recompile amule !

Note: before starting, remove ALL wxWidgets installations and previous aMule versions (this may save you some desperate hours) :)

btw, currently I have ~140 partfiles, ~500 clients to download from, 642 clients in the upload queue, and 21 shared files - CPU musage is 10.1% atm)
Title: Re: high cpu usage since rc4
Post by: snicker on November 06, 2004, 04:14:42 PM
ok. I downloaded wxWidgets from the wxwidgets.org
but now I don't know what I should do to install it.
in the 'from scratch' installation guide at amule's wiki the files are different.
I downloaded wxAll-2.5.3.tar.bz2 (http://prdownloads.sourceforge.net/wxwindows/wxAll-2.5.3.tar.bz2)
which means I don't have those 'base' and 'GTK' packages they mention at the wiki...
how do I install this new version, I see a INSTALL-X11.txt on the extracted dir, should I follow that?
"this may save you some desperate hours"
why ?
Title: Re: high cpu usage since rc4
Post by: GonoszTopi on November 06, 2004, 04:28:58 PM
To install wxWidgets:

$ ./configure --with-gtk --disable-gtk2
or
$ ./configure --with-gtk --enable-gtk2
or
$ ./configure --with-gtk --enable-gtk2 --enable-unicode

then

$ make

and as root do

$ make install
$ ldconfig

Then recompile aMule, and enjoy 8)

"this may save you some desperate hours" - because if you accidentally miss one step, aMule may configure itself to one version, and link to the other - this has happened to me once :( was real fun to find out why it doesn't do what I'd like to.

Have fun!
Title: Re: high cpu usage since rc4
Post by: stefanero on November 06, 2004, 04:35:56 PM
dont forget the prefix=/usr/
since amule will look in /usr/ not /usr/local/
Title: Re: high cpu usage since rc4
Post by: GonoszTopi on November 06, 2004, 04:40:43 PM
For me it's installed into /usr/local/, and works fine.
Title: Re: high cpu usage since rc4
Post by: phoenix on November 06, 2004, 09:23:45 PM
My compilation line, this is for debug, it has performance issues. For performance, use the one GonoszTopi gave before:

$ ./configure --enable-debug --disable-optimise --enable-debug_flag --enable-debug_info --enable-debug_gdb --enable-gtk2 --disable-unicode --prefix=/usr/local/wxWidgets-cvs && make && sudo make install

Notice that with the prefix I gave, aMule will not normally find the wx libraries. That has the advantage that I can have a different version of wx installed on my system, an I can easily erase it with

$ rm -rf /usr/local/wxWidgets-cvs

So when compiling aMule, I have to:

$ ./autogen.sh && ./configure --enable-debug --disable-optimize --enable-verbose --enable-webserver --enable-webservergui --enable-amulecmd --enable-amulecmdgui --enable-ccache --enable-amule-daemon --with-wx-config=/usr/local/wxWidgets-cvs/bin/wx-config && make

Notice also that I do not make install aMule, that is because I have to test several versions at the same time. So, to run a particular version of aMule, you do:

$ LD_LIBRARY_PATH=/usr/local/wxWidgets-cvs/lib/ ~/youramuledir/src/amule &

This way, you can have several versions of wxWidgets and several versions of aMule, all in different directories, so you can test wich configuration suits you best. For example, I have:

Code: [Select]
$ ls -d /usr/local/wx*
/usr/local/wxAmulePatches  /usr/local/wxWidgets-2.5.2  /usr/local/wxWidgets-cvsu   /usr/local/wxWindows-2.5.1
/usr/local/wxBase-2.4.2    /usr/local/wxWidgets-cvs    /usr/local/wxWindows-2.4.2  /usr/local/wxWindows-2.5.1u

And a corresponding version of aMule for each wx configuration. If you use the default prefix, that is, /usr/local, you will not be able to have more than one wx in your system. Also, notice that you can install all wx with a prefix like ~/wx/wxWidgets-2.5.3, so you dont even have to be root to have a new version of wx working for you.
Title: Re: high cpu usage since rc4
Post by: snicker on November 08, 2004, 11:45:01 AM
wow, thanks for all the response, you guys rock!

I recompiled using wxWidgets 2.5.3.
I first erased everything: amule (make uninstall?) and wxwidgets (using the how-to at the wiki)
Then compiled the 2.5.3 version (don't forget to get the patch to the eggtrayicon.h, otherwise it will not compile!). I used the flag '--enable-gtk2' this time.
Then, recompiled amule using:
$ ./autogen.sh
$ ./configure --enable-debug --enable-optimise --prefix=/usr --enable-verbose --disable-systray
$ make && make install

now aMule looks great (gtk2), BUT cpu usage is still around 35-40%!!! (and what is more: I noticed that as times goes, it raises, up to 87%!!!!)
how come!?!
I must be doing something terribly wrong...
I even tried without the '--enable-debug' and '--enable-verbose' flags, but nothing changed..

more info on what I'm using here:
145 .part files
300 connections allowed (in preferences).
143 shared files

I'm damned! there has to be another way...
Title: Re: high cpu usage since rc4
Post by: stefanero on November 08, 2004, 12:06:51 PM
yup

gtk2 is still not really good suppored by wxGTK, thats why you have so high CPU usage and also it will eat up a lot of Memory.

compile wxGTk with gtk1 and be amazend by the huge difference in cpu and mem usage.

so its not really amule problem its wxGTK problem. and atm not much you can do about it. basically only hope that wxGTK will fix this gtk2 issue in next release.

greez
stefanero
Title: Re: high cpu usage since rc4
Post by: snicker on November 08, 2004, 12:12:28 PM
well, I'll try that, but the thing is, the cpu usage is very similar to what it was before (with gtk1)...
I'm still wondering... I'll go compile (again!!!) and get back here.
Title: Re: high cpu usage since rc4
Post by: snicker on November 08, 2004, 12:52:41 PM
here I go again:
compiled wx WITHOUT gtk2 (and using phoenix's method):
$ ./configure --with-gtk --disable-gtk2 --prefix=/usr/wxWidgets-gtk1 --enable-unicode
then compiled amule:
$ ./autogen.sh
$ ./configure --enable-optimise --disable-systray -with-wx-config=/usr/wxWidgets-gtk1/bin/wx-config
$  make
then ran amule:
$ LD_LIBRARY_PATH=/usr/local/wxWidgets-gtk1/lib/ ~/MYamuledir/src/amule

and...: still using 30-50% cpu!!!
so... sorry, stefanero, but I think you were wrong.... (to my despair!)

By the way, I'm using amule-cvs for today (08/11/04).

I also noticed that cpu usage starts at ~6-11% when I start amule, then goes up as the connection to the server starts (to about 18%), then, it gets even higher when I start to download files (to ~25%) and finally to ~30% when uploads start. don't know if this helps...
Title: Re: high cpu usage since rc4
Post by: stefanero on November 08, 2004, 01:23:44 PM
what cpu you have?
I have hear a amd 2000+ and runs with debug amule and debug wxWidgets around 15% with gtk1 and 5-10 downloads....
of course in the sources searching process and while downloads are really high cpu rises but not really that much here.

btw unicode and gtk1 dont work

stefanero
Title: Re: high cpu usage since rc4
Post by: snicker on November 08, 2004, 01:43:03 PM
I have an athlon XP 2400+ (real clock: 2Ghz)
as I said, I compiled without debugs and cpu usage is very high... maybe I'm constantly searching for sources, could that be it? I have 148 downloads, of which about 10 at the same time (meaning: are currently being downloaded) the others are in queue or something similar.

"btw unicode and gtk1 dont work" yep, I noticed.

thanks again for all the attention!
Title: Re: high cpu usage since rc4
Post by: Jacobo221 on November 08, 2004, 03:13:51 PM
first, i believe a 2400+'s real clock is 1500MHz ;)

going into what the issue is:

Make sure you are using amule.org's rpms, not your distro's ones.
also linking wx 2.4.x against gtk2 could be the problem too

Greetings!
Title: Re: high cpu usage since rc4
Post by: stefanero on November 08, 2004, 03:33:06 PM
Jacobo221:maybe you should not only read the last post sometimes ;)
Title: Re: high cpu usage since rc4
Post by: snicker on November 08, 2004, 03:54:09 PM
:D

btw, 2400 clock's is 2Ghz:
$ cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 6
model           : 8
model name      : AMD Athlon(TM) XP 2400+
stepping        : 1
cpu MHz         : 2001.026
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow
bogomips        : 3964.92

but I don't think this matters....
Title: Re: high cpu usage since rc4
Post by: stefanero on November 08, 2004, 05:12:46 PM
have you let it run for a while and look after the cpu usage after its done with finding sources!?!?
but with gtk1 ;) not gtk2
Title: Re: high cpu usage since rc4
Post by: snicker on November 08, 2004, 07:53:46 PM
yep.
it is active for 7 hours now and cpu usage is steady at 30%...
Title: Re: high cpu usage since rc4
Post by: phoenix on November 08, 2004, 08:01:25 PM
Quote
Originally posted by snicker
I also noticed that cpu usage starts at ~6-11% when I start amule, then goes up as the connection to the server starts (to about 18%), then, it gets even higher when I start to download files (to ~25%) and finally to ~30% when uploads start. don't know if this helps...

I can confirm that, I have a secondary slower machine and I get high cpu usage that grows in the long run. Don't know if this is related, but this is a lowid machine.

Cheers!
Title: Re: high cpu usage since rc4
Post by: snicker on November 09, 2004, 02:39:04 PM
is this thread really dead.... I'm so sad... ;(
and my cpu is so tired...

no, really. what is the status here? should I give up? is this a bug? is there anything else I can do?
Title: Re: high cpu usage since rc4
Post by: stefanero on November 09, 2004, 02:47:39 PM
I think not much you can do....

all of the things we use did not work for you...and like I said except usung 2.5.3 with gtk1 is not much you can do to save your cpu.
you can try CVS snapshot which has a lot of socket/sources work done from Kry which made CPU usage drop also a lot here.
give that a shoot and if that does not help I am out of answers here.
sorry pal

stefanero
Title: RE: high cpu usage since rc4
Post by: Ateo on December 01, 2004, 11:50:54 PM
Well, after doing some research (on my distro), I have found that there is an issue with wxGTK-2.5.3 with opengl support. So, you might want to recompile wxGTK-2.5.3 without opengl support.

I had the same CPU issue but because I had 2.5.3 installed with opengl support. I'm now downgrading to 2.4.2 and recompiling amule. I"m going to try compiling with and withou gtk2 support to see how it works for myself.

[edit]
I ended up compiling amule without gtk2 support. I'll wait until wxGTK-2.5.3 has it glitches worked out. My CPU usage dropped and remains consistant.
Title: RE: high cpu usage since rc4
Post by: elfstone on February 18, 2005, 08:24:10 PM
Hi, i know the thread is old, but the Preblem is still the same, s i guess its better to use this thread.

I have AMD XP2000 (funny, no intel-users around) and my CPU-usage is around 30-40% with 15 downloads, and it wont get lower after searching all sources. I have wxGTK 2.5.

How much cpu-usage would i get, if i compile without GTK2? Any other news about this problem?


Edit:
Argh: Should have tried this earlier, disabled GTK, and now i get around 5% CPU-Usage. Great, at least i can keep running amule while using the computer.

Edit2: Damn it, i posted too fast, after connecting to a server cpu-usage gor back to 30%... So it seems that its not a gui-Problem, but something in the networkcode. Is everyone experiencing such a high cpu-usage, or does it only happen on "some" systems? I already switched to 200 connections, didnt help much.