"Top" command shows diffrent cpu usage %

Support for the other architectures (X86_64, s390(x) and PowerPC)
Post Reply
SyRenity
Posts: 39
Joined: 2006/12/25 17:15:42

"Top" command shows diffrent cpu usage %

Post by SyRenity » 2007/01/30 19:03:32

Hi.

I have a dual-core, dual-x64 CPU box. When running the top command, I see one of the processes taking ~40 of %CPU. But the Cpu(s) line in the summary above shows only ~20%.

Why the summary is so low, and which value should be then trusted to measure the actual CPU load?

Thanks.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

"Top" command shows diffrent cpu usage %

Post by gerald_clark » 2007/01/30 19:12:33

40% of one CPU is 20% of two CPUs.

pjwelsh
Posts: 2589
Joined: 2007/01/07 02:18:02
Location: Central IL USA

Re: "Top" command shows diffrent cpu usage %

Post by pjwelsh » 2007/01/30 19:17:39

"load" is a fun one... the one in top shows processes waiting for CPU. Most of the time when you see something like you describe, the CPU is *stuck* waitiing for something *else* and the "load" increases. Most oftem this is due to waiting for I/O (eg disk) or interupts (eg NIC traffic) etc.

"vmstat" and "iostat" may give additional system perspective (read man page for what columns mean). Or run sysstat on startup (from the syssstat package) and use "sar" with it. Or find some nice monioring program like zabbix etc... There are a TON of options...

SyRenity
Posts: 39
Joined: 2006/12/25 17:15:42

Re: "Top" command shows diffrent cpu usage %

Post by SyRenity » 2007/01/31 09:51:29

Thanks for the explanation, but what can be used to show me the actual CPU load?

Is the top command CPU summary (20% in this case) can be trusted as the overall CPU load?

Thanks again.

pjwelsh
Posts: 2589
Joined: 2007/01/07 02:18:02
Location: Central IL USA

Re: "Top" command shows diffrent cpu usage %

Post by pjwelsh » 2007/01/31 14:11:03

Think of load as a piece of the system puzzle. By itself, load avg is almost as useful as walking outside for 10 seconds and predicting the weather. To continue the (bad) weather ananalogy, you have many factors that contribute to weather- highs, lows, jet-streams, moister, bodies of water, mountain ranges etc. Each has some influence on the other in some way... Load avg is just a piece of your puzzle... sometimes it's good, sometimes it's bad...

*YOU* are the magic bullet in this case! You need to know and understand the system, the apps, the load, the connections and ALL of that. Sure you can use any number of monitoring scripts/programs/whatever to look for out of band situations, but *YOU* need to decide on that (or the users that scream at you :lol: )

SyRenity
Posts: 39
Joined: 2006/12/25 17:15:42

Re: "Top" command shows diffrent cpu usage %

Post by SyRenity » 2007/02/01 11:10:00

Thanks for the explanation.

Post Reply