Page 1 of 1

"Top" command shows diffrent cpu usage %

Posted: 2007/01/30 19:03:32
by SyRenity
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.

"Top" command shows diffrent cpu usage %

Posted: 2007/01/30 19:12:33
by gerald_clark
40% of one CPU is 20% of two CPUs.

Re: "Top" command shows diffrent cpu usage %

Posted: 2007/01/30 19:17:39
by pjwelsh
"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...

Re: "Top" command shows diffrent cpu usage %

Posted: 2007/01/31 09:51:29
by SyRenity
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.

Re: "Top" command shows diffrent cpu usage %

Posted: 2007/01/31 14:11:03
by pjwelsh
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: )

Re: "Top" command shows diffrent cpu usage %

Posted: 2007/02/01 11:10:00
by SyRenity
Thanks for the explanation.