LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Why is my machine so slow? (https://www.linuxquestions.org/questions/linux-software-2/why-is-my-machine-so-slow-482481/)

Hacker X 09-11-2006 01:08 PM

Why is my machine so slow?
 
The old machine was a 233MHz P-II with 64MB RAM.
It used to run W98/IE, no virusware.
It wasn't fast, but menus and other popups generally appeared in a basically natural way, so I didn't feel like I was waiting for them all the time. All I had to do was track down and delete a virus once in a while.

Now I have a 500MHz K6-2 with 128MB RAM running Slackware(Zenwalk)/XFCE/Firefox.

It's DOG SLOW.

Firefox menus are slow, saving files is slow, Thunderbird newsreader is slow.
So the cpu is twice as fast, twice as much RAM, with OS, desktop, and browser that are all supposedly faster, and yet the mouse motion is still more herky-jerky than with the old M$ system.

I have too much confidence in *nix software to believe this is normal. Is there some misconfiguration that's creating a bottleneck somewhere? Would a different kernel help? This crappy performance is very frustrating, and I would very much like to fix it. Any help or ideas are welcome.

stress_junkie 09-11-2006 01:18 PM

The same thing happened to me when I first installed OpenSuSE v10.1 a few days ago. When I first installed it the GUI ran unbelievably slow. I fixed it but I'm not sure exactly what happened. I have an ATI Radeon 8500 AIW card so I ran the installation for the drivers from ATI. The computer ran MUCH faster after that. The interesting thing is that /etc/X11/xorg.conf isn't really set correctly to run the ATI driver. I'm not going to change it, though. I don't need OpenGL or hardware acceleration so I'm leaving it as it is. I'm running the 2.6.16 kernel.

DotHQ 09-11-2006 01:21 PM

Could you post stats from top or uptime? Top will show what resources are being used, top processes and load average all on one screen. It updates every 10 or 15 seconds automatically.

uptime will show how long the system has been up, and load averages at that moment in time. Load averages will tell if your system is really working or not. The load average rule of thumb is 2.0 and below is okay. Sustained periods above that and your system will show signs of a slow down. (load average is synonymous with a line at a movie theatre. With 2 in line you'll get farily quick service. The more you get above 2 the longer your wait will be. Only load average represents the processes waiting in line for CPU service.)

macemoneta 09-11-2006 01:25 PM

128MB RAM is a little light these days. When you run top, what processes are consuming the most CPU, and memory (hit 'M' to sort by memory usage). Firefox with a typical set of plugins and extensions typically uses 50+MB resident, 150MB total memory. I'd say RAM is probably the bottleneck.

Comparing Win98 to Linux on that hardware is not really comparable. Compare Vista, since the functionality is approximately comparable. Yes, operating systems have gotten quite bloated. The reason is because of the incredible drop in the cost of processing, memory and storage.

I still remember buying for my home computer: 16K of RAM for $275, 10MB HD for $1000 and a 200KIP computer for $2000. For many computers, 512MB of RAM is under $50 these days. Unless you are doing embedded system design (and even many of those have more resource than your machine), it's not worth spending the time fighting to optimize for a constrained environment.

Hacker X 09-11-2006 07:18 PM

Quote:

Originally Posted by DotHQ
Could you post stats from top or uptime?

Quote:

Originally Posted by macemoneta
When you run top, what processes are consuming the most CPU, and memory (hit 'M' to sort by memory usage). Firefox with a typical set of plugins and extensions typically uses 50+MB resident, 150MB total memory.

firefox 41%
X 13-15%
misc. other apps 6% or less

OR

firefox 33%
thunderbird 21%
X 12%
etc.

Quote:

128MB RAM is a little light these days.
I'd say RAM is probably the bottleneck.
So that's a bigger problem than the cpu?
top says there's about 5-7MB free memory, 111M used out of 118M total.
Load is around 1 or less.

Quote:

Comparing Win98 to Linux on that hardware is not really comparable. Compare Vista, since the functionality is approximately comparable. Yes, operating systems have gotten quite bloated.
Okay, that's an answer. But does that mean compiling a new kernel would help?

Quote:

Unless you are doing embedded system design (and even many of those have more resource than your machine), it's not worth spending the time fighting to optimize for a constrained environment.
My finances are somewhat constrained right now. Are there any smaller browsers or other options? Is the desktop a non-issue?

Tinkster 09-11-2006 07:29 PM

Quote:

Originally Posted by Hacker X
firefox 41%
X 13-15%
misc. other apps 6% or less

OR

firefox 33%
thunderbird 21%
X 12%
etc.

Are you playing flash-animations or something? That CPU consumption
seems quite inappropriate, even on a machine with those specs.


Quote:

Originally Posted by Hacker X
So that's a bigger problem than the cpu?
top says there's about 5-7MB free memory, 111M used out of 118M total.
Load is around 1 or less.

That, too, is too high. Can you post the output of top -b -n 1 here?
Also check for errors in /var/log/ and dmesg.


Quote:

Originally Posted by Hacker X
Okay, that's an answer. But does that mean compiling a new kernel would help?

You may find SOME improvement ... one other thing you may look at
is whether DMA is enabled or not.



Cheers,
Tink

DotHQ 09-11-2006 07:30 PM

nevermind ....i was to slow.

Hacker X 09-11-2006 09:34 PM

0123456789

Hacker X 09-11-2006 09:48 PM

Quote:

Originally Posted by Hacker X
firefox 41%
X 13-15%
misc. other apps 6% or less

Quote:

Originally Posted by Tinkster
Are you playing flash-animations or something?

That's % memory.

Quote:

Can you post the output of top -b -n 1 here?
Code:

top - 21:15:52 up 11:37,  2 users,  load average: 0.63, 0.66, 0.57
Tasks:  67 total,  1 running,  65 sleeping,  1 stopped,  0 zombie
Cpu(s): 24.2% us,  3.1% sy,  1.3% ni, 70.6% id,  0.6% wa,  0.3% hi,  0.0% si
Mem:    117748k total,  112508k used,    5240k free,      292k buffers
Swap:  249976k total,    92032k used,  157944k free,    27012k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1998 root      15  0 46892  18m 3388 S  5.3 15.7 101:10.63 X
 2962 dan      16  0  2212 1000  760 R  5.3  0.8  0:00.09 top
 2039 dan      15  0 10120 2632 2176 S  1.8  2.2  19:45.64 xfce4-cpugraph-
 2109 dan      15  0  140m  51m  13m S  1.8 44.6  53:49.09 firefox-bin

Quote:

Also check for errors in /var/log/ and dmesg.
Interesting. So are hackers watching this forum? I've never seen this before, and I checked /var/log/messages several times a couple months ago when I was debugging pppd/chat.

This is only a sample. There are about 30-40 attempts total:
Code:

Sep 11 20:03:49 zenwalk sshd[2790]: Failed password for invalid user admin from 202.57.35.38 port 47669 ssh2
Sep 11 20:03:55 zenwalk sshd[2794]: Invalid user admin from 202.57.35.38
Sep 11 20:03:55 zenwalk sshd[2794]: Failed password for invalid user admin from 202.57.35.38 port 48635 ssh2
Sep 11 20:04:00 zenwalk sshd[2798]: Invalid user admin from 202.57.35.38
Sep 11 20:04:01 zenwalk sshd[2798]: Failed password for invalid user admin from 202.57.35.38 port 50402 ssh2
Sep 11 20:04:06 zenwalk sshd[2802]: Invalid user admin from 202.57.35.38
Sep 11 20:04:06 zenwalk sshd[2802]: Failed password for invalid user admin from 202.57.35.38 port 51370 ssh2
Sep 11 20:04:11 zenwalk sshd[2806]: Invalid user admin from 202.57.35.38
Sep 11 20:04:11 zenwalk sshd[2806]: Failed password for invalid user admin from 202.57.35.38 port 52330 ssh2

Nothing else that I would recognize, but that's not saying much.

Quote:

You may find SOME improvement ... one other thing you may look at is whether DMA is enabled or not.
Could you explain what that is?

macemoneta 09-11-2006 09:57 PM

Half your memory is in swap. That will slow you down rather considerably. To check for DMA (direct memory access) on your disk drive, as root:

Code:

# hdparm -v /dev/hda

/dev/hda:
 multcount    = 16 (on)
 IO_support  =  1 (32-bit)
 unmaskirq    =  1 (on)
using_dma    =  1 (on)
 keepsettings =  0 (off)
 readonly    =  0 (off)
 readahead    = 4096 (on)
 geometry    = 16383/255/63, sectors = 156301488, start = 0

To enable it:

hdparm -d1 /dev/hda

Tinkster 09-11-2006 10:14 PM

Quote:

Originally Posted by Hacker X
That's % memory.


Code:

top - 21:15:52 up 11:37,  2 users,  load average: 0.63, 0.66, 0.57
Tasks:  67 total,  1 running,  65 sleeping,  1 stopped,  0 zombie
Cpu(s): 24.2% us,  3.1% sy,  1.3% ni, 70.6% id,  0.6% wa,  0.3% hi,  0.0% si
Mem:    117748k total,  112508k used,    5240k free,      292k buffers
Swap:  249976k total,    92032k used,  157944k free,    27012k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1998 root      15  0 46892  18m 3388 S  5.3 15.7 101:10.63 X
 2962 dan      16  0  2212 1000  760 R  5.3  0.8  0:00.09 top
 2039 dan      15  0 10120 2632 2176 S  1.8  2.2  19:45.64 xfce4-cpugraph-
 2109 dan      15  0  140m  51m  13m S  1.8 44.6  53:49.09 firefox-bin


Code:

  2109 dan      15  0  140m  51m  13m S  1.8 44.6  53:49.09 firefox-bin
That is indeed a memory issue. firefox is using (trying to use) 140MB of
128MB ... that explains the performance and the CPU usage.

Quote:

Interesting. So are hackers watching this forum? I've never seen this before, and I checked /var/log/messages several times a couple months ago when I was debugging pppd/chat.
They may - but that wouldn't give them your IP; that's just a random ssh
attack. If you don't like them filling up your logs, have a look at this post




Cheers,
Tink

Hacker X 09-11-2006 10:18 PM

Quote:

Originally Posted by macemoneta
Half your memory is in swap. That will slow you down rather considerably. To check for DMA (direct memory access) on your disk drive, as root:

Yes, it's on.

Hacker X 09-13-2006 02:02 AM

Thanks for all the help.


All times are GMT -5. The time now is 08:40 PM.