Operating System - HP-UX
1837970 Members
2864 Online
110124 Solutions
New Discussion

How to get the individual CPU usage report on one multiple CPUs

 
SOLVED
Go to solution
albert_hua
Frequent Advisor

How to get the individual CPU usage report on one multiple CPUs

Hi,everyone:
I want to gather the usage info of the CPUs of one HP UNIX server for several days.
I tried Perfview but it can only get the average usage info of the multiple CPUs and then I thought of GlancePlus but unfortunately it can only get current usage info of individual CPU.
So I am very eager to find one tool or method to solve this question.
Any idea will be appreciated.

albert
When going with others together, I can always find my adviser among them. (三人行必有我师也)
10 REPLIES 10
Ken Hubnik_2
Honored Contributor

Re: How to get the individual CPU usage report on one multiple CPUs

Why don't you gather the information using measureware and use Perfview to analyze it.
albert_hua
Frequent Advisor

Re: How to get the individual CPU usage report on one multiple CPUs

Hi,Ken:
I said I want to get the usage info of every CPU individually.
Thanks.


albert
When going with others together, I can always find my adviser among them. (三人行必有我师也)
William Baines
Frequent Advisor

Re: How to get the individual CPU usage report on one multiple CPUs

Hi Albert,

Use sar -M command to get per processor stats:

You will get a display similar to this:
00:00:00 cpu %usr %sys %wio %idle
00:20:00 0 16 3 2 79
1 15 6 2 77
2 17 5 2 76
3 17 4 2 77
system 17 4 2 77

Averages are included at the bottom of the report.
Work smarter, not harder
Sean OB_1
Honored Contributor

Re: How to get the individual CPU usage report on one multiple CPUs

Albert,

Top can show you this. However for real monitoring you'll want to use something like Glance or Measureware.

Both will track individual CPU stats. Perfiew can report on individual CPU or global CPU stats.
keith persons
Valued Contributor

Re: How to get the individual CPU usage report on one multiple CPUs

Albert,

Actually, there would be 2 methods - with Perfview C.03.58 (possibly earlier too) select the Class Compare template, then CPU, select all then Total Util. You'll also have the choice of getting just user more or system mode.

The other method would require using sar where the data is collected via cron (examples in man pages for sa2). Then you can run sar -M against the respective data files and retrieve each days data on a perprocessor basis.

Hope this helps,

keith
albert_hua
Frequent Advisor

Re: How to get the individual CPU usage report on one multiple CPUs

To William,
I know 'sar' can get the usage info of individual CPU but I think it is hard to get the statistics for a long time such as one day.

To Sean,
I do want to get statistics for one day so I think top and GlancePlus can not solve my question.
As for Perfview, I tried my best to look for the metric indicating individual CPU usage but I failed. But since you say that Perfview can do it I think you must have successed to do it with Perfview. So will you be kindly to give me some hints about it ?

Thanks again.

Al.
When going with others together, I can always find my adviser among them. (三人行必有我师也)
Leif Halvarsson_2
Honored Contributor

Re: How to get the individual CPU usage report on one multiple CPUs

Hi
Run top from cron evry minute (for example) and collect the output in a file.



* * * * * top -n1 -d1 >>/tmp/toplog
Sritharan
Valued Contributor

Re: How to get the individual CPU usage report on one multiple CPUs

Hi,

The best command to get the invidual cpu usage is top.

You also can this command on crontab if you want to see the usage only on certain times.

you can point out the output to a file

man top command and crontab command.

You can also check on the timex command(i not yet tried)


Thanks & Regards
Sri
Known is a drop...unknown is an ocean -> quote from a movie
Steven Gillard_2
Honored Contributor
Solution

Re: How to get the individual CPU usage report on one multiple CPUs

There are some BYCPU metrics available from the measureware performance agent:

BYCPU_CPU_SYS_MODE_UTIL
BYCPU_CPU_TOTAL_UTIL
BYCPU_CPU_USER_MODE_UTIL
BYCPU_CSWITCH_RATE
BYCPU_ID
BYCPU_INTERRUPT_RATE
BYCPU_STATE

However, they are not logged by default. To turn collection of them on, you need to add "cpu" to the "log... dev=" line in your /var/opt/perf/parm file. You can then use the extract command and perfview to view these metrics.

Regards,
Steve
Sean OB_1
Honored Contributor

Re: How to get the individual CPU usage report on one multiple CPUs

Measureware has several metrics for individual cpu's.

Here's is a list of them:

BYCPU_CPU_SYS_MODE_UTIL
BYCPU_CPU_TOTAL_UTIL
BYCPU_CPU_USER_MODE_UTIL
BYCPU_CSWITCH_RATE
BYCPU_ID
BYCPU_INTERRUPT_RATE
BYCPU_STATE

However measureware doesn't log all metrics by default out of the box, so you may have to turn on these metrics via the parm file to have them logged.