Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to monitor CPU-Usage on a SLES 10 Server.
My question is which "CPU percentages" should I use to calculate the CPU-Usage...?
I know when you run "top" you can see about 8 different percentages lined up at the top of the page, which are:
(%user, %system, %nice, %idle, %wait, %interrupts, %soft, %steal)
You also get the same 8 percentages when you run "mpstat -P ALL".
Running vmstat you can see 5 percentages for CPU:
(%user, %system, %idle, %wait, %steal)
If I misunderstood any of the abbreviations that they use for the cpu %, please let me know.
So which of those are the most important? Also, whichever one's are the most important can I just add them and average them out?
If anyone has any suggestion please feel free to let me know.
I've searched all over and couldn't find a definite answer.
I would use the load instead, but that's just me. It's time averaged, smooth, and incorporates everything that draws CPU time. You also have multiple values giving you the average load over different time scales, so you can see if the spike in load is just temporary or if it's been going on for a while.
That would be absolutely the worst thing to do.
For definitions see the manpage(s). Also see the manpage for proc - particularly /proc/stat as that is where all the numbers probably come from.
Given how rubbery the numbers are in the first place, might be simplest to merely use "100-idle-wait-steal".
idle and wait are complements of each other for unused CPU - steal should be zero for a stand-alone (non-virtualized) server.
Doesn't give any idea of balance across CPUs/cores of course - you could do it all yourself from /proc/stat if you feel inclined.
I wish they would make this a little bit harder and a bit more confusing to get something like CPU Usage in a percentage... But oh well!
suicidaleggroll,
I decided to go with your suggestion using the load average from the first line of the top command.
I think I'm just going to have a simple Perl script to extract the "load average" from the output of "top -n 1"... Simple enough.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.