aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Huge CPU Usage  (Read 5544 times)

Aypok

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
    • http://tuxserve.sf.net/
Huge CPU Usage
« on: July 29, 2004, 09:40:40 PM »

Hi,

Since I started using aMule (quite a few versions back) it's used all my spare CPU power. This didn't concern me much, as it was on a slow system - but I've now got an XP2800 CPU running at 2Ghz, with 512mb DDR333 RAM. This worried me a bit.

It only seems to use spare CPU power, so it doesn't slow the whole system down (so it's not a major problem) - but aMule itself is very unresponsive and slow - taking an average of 3 to 10 seconds to update the display and respond to my input. No other applications on my system have this problem.

The CPU usage of aMule follows a pattern: 3 seconds using as much CPU power as it can get, then 7 seconds of using small amounts (it varies between a few % and about 20%). There seems to be no difference in the CPU usage when I'm downloading 1 file, or 25 - it's the same.

I've looked throught the preferences again and again to find something that could be causing this problem - but I never find anything.

I'm running aMule 1.2.8 (built from source) on Slackware 9.0 and a 2.4.20 kernel, with WX_GTK 2.4.2. If you need any more information (aMule settings, systems specs, etc) let me know.

Thanks in advance,


Aypok...
Logged
"Bastardman! The Chief cries as we slip into a parking space outside the station with the grace and ease of a car accident. Which in fact it was..." - BOFH

Jacobo221

  • Hero Member
  • *****
  • Karma: 3
  • Offline Offline
  • Posts: 2712
Re: Huge CPU Usage
« Reply #1 on: July 29, 2004, 10:27:31 PM »

hm. it takes 5% CPU here and around the same on memory here and on mostly every pc I've seen logs of).
Did you compile it yourself? get from rpms or debs? please be verbose a little more.
Gretigns!
Logged

deltaHF

  • Evil Admin
  • Former Developer
  • Hero Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 3920
  • .. Legends may sleep, but they never die ..
    • http://www.amule.org
Re: Huge CPU Usage
« Reply #2 on: July 29, 2004, 11:11:23 PM »

well, if u have auto-priority enabled disable it. and also be sure u don't have verbose on

greets

Aypok

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
    • http://tuxserve.sf.net/
Re: Huge CPU Usage
« Reply #3 on: July 29, 2004, 11:12:38 PM »

Hi,

As I said in my original post - I compiled it from source, as I did with WX_GTK (and most things, for that matter). All versions of aMule that I've used have been compiled from source by me.

I don't mind it using 5%, or even 20% - but when it uses upto 95% of CPU power on a 2Ghz machine (for 3 seconds out of every 10), you start to wonder what's going on :) Memory use isn't a problem - it's about 20mb.

Here's some of my aMule settings, incase they can help: (high ID)

Max sources per file (hard limit): 350
Max connections: 200
Max new connections / 5 seconds: 20
File buffer size: 240000
Upload queue size: 5000 clients
Server connection refresh interval: Disabled

I think those are the default settings (feel free to correct me on that). Any other settings/info you wish to know?


Aypok...
Logged
"Bastardman! The Chief cries as we slip into a parking space outside the station with the grace and ease of a car accident. Which in fact it was..." - BOFH

deltaHF

  • Evil Admin
  • Former Developer
  • Hero Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 3920
  • .. Legends may sleep, but they never die ..
    • http://www.amule.org
Re: Huge CPU Usage
« Reply #4 on: July 29, 2004, 11:18:13 PM »

look above ;)

Aypok

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
    • http://tuxserve.sf.net/
Re: Huge CPU Usage
« Reply #5 on: July 29, 2004, 11:26:51 PM »

Hi,

Sorry - a bit slow in replying (I found the games section on the forums :D)

Verbose mode is off, but "Add files to download with auto priority" was on (and most downloads were set to "auto"). I first switched off "Add files to download with auto priority" and instantly aMule was much faster. Except for every 7 seconds it lagged a bit (due to the high CPU usage). I set all priorities on downloads to "Low" - but that made no noticable difference.

So it's "fixed" - in a way :) aMule isn't annoyingly slow to use (most of the time). But it doesn't explain why it still uses all that CPU power...

Thanks.


Aypok...
« Last Edit: July 29, 2004, 11:27:28 PM by Aypok »
Logged
"Bastardman! The Chief cries as we slip into a parking space outside the station with the grace and ease of a car accident. Which in fact it was..." - BOFH

deltaHF

  • Evil Admin
  • Former Developer
  • Hero Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 3920
  • .. Legends may sleep, but they never die ..
    • http://www.amule.org
Re: Huge CPU Usage
« Reply #6 on: July 29, 2004, 11:31:57 PM »

ps u -C amule

Aypok

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
    • http://tuxserve.sf.net/
Re: Huge CPU Usage
« Reply #7 on: July 29, 2004, 11:37:25 PM »

Hi,

aypok@localhost:~$ ps u -C amule
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
aypok     1164 33.7  4.1 37140 21564 pts/0   R    10:45 239:14 amule
aypok     1165  0.0  4.1 37140 21564 pts/0   S    10:45   0:00 amule
aypok     1166  0.0  4.1 37140 21564 pts/0   S    10:45   0:00 amule


Aypok...
Logged
"Bastardman! The Chief cries as we slip into a parking space outside the station with the grace and ease of a car accident. Which in fact it was..." - BOFH

deltaHF

  • Evil Admin
  • Former Developer
  • Hero Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 3920
  • .. Legends may sleep, but they never die ..
    • http://www.amule.org
Re: Huge CPU Usage
« Reply #8 on: July 29, 2004, 11:39:29 PM »

try to make the upload queue a bit smaller first (~ 2000) .. look if u don't have shared files on auto-prio, if yes, disable

if both doesn't help: close amule, mv .aMule .aMule2 and restart

Aypok

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
    • http://tuxserve.sf.net/
Re: Huge CPU Usage
« Reply #9 on: July 30, 2004, 12:29:25 AM »

Hi,

I set the upload queue size to 2000, set "Add new shared files with auto priority" off, and set the priority of all shared files to "Normal". I left it a few minutes, but it was still the same.

I tried your second idea - which worked perfectly :) aMule now uses about 1% to 2% CPU power.

But there is something else "odd". My old directory was ~/.xMule/ (converted when I first used aMule) - so I renamed that to something different. However, when I ran aMule again, it gave the following error:

"Can not enumerate files '/home/aypok/.xMule/Incoming/*' (error 2: No such file or directory)"

There's more of this sort of thing if I click "details".

I quit out of aMule to make sure I hadn't missed anything (and wondering how it remembered the old directory name), then found a new ~/.aMule/, which I also renamed to something else. When I re-ran aMule the same thing happened again. It didn't see any of my files that I was downloading nor any of my shared files (obviously), but it DOES remember my settings in the preferences window. I was under the impression these settings were all stored in the ~/.xMule/ or ~/.aMule/ directories. How did it know to look in ~/.xMule/ and remeber my preferences? I guess that's a problem (?) for another time :)

Anyhoo, I've now re-added all my old files and it's working fine :)

Thanks for all your help, and your speed in doing so. Keep up the great work.


Aypok... (off to play more of those forum games!)
Logged
"Bastardman! The Chief cries as we slip into a parking space outside the station with the grace and ease of a car accident. Which in fact it was..." - BOFH

deltaHF

  • Evil Admin
  • Former Developer
  • Hero Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 3920
  • .. Legends may sleep, but they never die ..
    • http://www.amule.org
Re: Huge CPU Usage
« Reply #10 on: July 30, 2004, 12:34:54 AM »

propably some broken file since xmule (as amule copy some config files from .xMule dir).. anyway, have fun :)

Citroklar

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 148
Re: Huge CPU Usage
« Reply #11 on: July 30, 2004, 02:37:43 AM »

Heh, you've just run into ~/.eMule - this is a config file, used by xmule and amule. it's there for some weird coding reason, complicated to explain, but if you want to completely re-setup amule, you will have to delete or rename this file in addition to the .aMule/ folder.
Logged
#!/bin/ssh
#The Unix Guru's View of Sex
unzip ; strip ; touch ; grep ; finger ; mount ; fsck ; more ; yes ; umount ; sleep

Aypok

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
    • http://tuxserve.sf.net/
Re: Huge CPU Usage
« Reply #12 on: July 31, 2004, 12:08:55 AM »

Hi,

It seems my celebration was a bit premature, as aMule had reverted to its previous pattern of CPU usage by the time I had woken up this morning. I'd changed nothing since I "fixed" it and posted last night.

It seems that if I leave aMule running, it will slowly start using more and more CPU power. I can close aMule, but this is only a temporary solutions, as it will start using more CPU power again.

I'm not using any of the old config files (to get the old downloads working I did and "ln -s" to the old download folders - no config files were copied of symlinked) - so I'm not sure what the problem is.

Maybe it'd be worth deleting the ~/.eMule file (I assume that was also left over from my xMule days) - thanks for explaining about that Citroklar :) I'll try this method and leave it for a day or 2, to see if it makes any difference.

Thanks again.


Aypok
Logged
"Bastardman! The Chief cries as we slip into a parking space outside the station with the grace and ease of a car accident. Which in fact it was..." - BOFH

TuxPower

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 1
Re: Huge CPU Usage
« Reply #13 on: August 03, 2004, 05:22:35 PM »

I had the same problem as you, but now I think I have solved it.
Try and uncheck 'Update serverlist when a client connect' under 'Server'.

Now my aMule uses 20-45 % CPU instead of 65-95 % CPU. Also try to minimize aMule, it seems to save 5-10 % CPU extra.
« Last Edit: August 03, 2004, 05:32:23 PM by TuxPower »
Logged
I'm not a psychopath, I'm a sociopath.
There's a difference, you know.
A psychopath can't tell the difference between right and wrong.
A sociopath knows the difference - he just doesn't care.

Aypok

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 9
    • http://tuxserve.sf.net/
Re: Huge CPU Usage
« Reply #14 on: August 03, 2004, 10:13:01 PM »

Hi,

Thanks for the tips - I did have that option enabled. However, I'm not sure if that was the problem - I upgraded to the latest version of aMule (2.0.0rc5) as suggested in another thread (http://www.amule.org/amule/thread.php?threadid=3127&sid=). As I said then, it fixed the problem (yep - it's *still* fixed :) ).

I still have 'Update serverlist when a client connect' enabled in this new version, but the CPU usage is minimal - averaging about 4%. It might just have been a problem with the previous version... I guess I'll never know :)

Thanks.


Aypok...
Logged
"Bastardman! The Chief cries as we slip into a parking space outside the station with the grace and ease of a car accident. Which in fact it was..." - BOFH