Operating System - HP-UX
1830732 Members
1889 Online
110015 Solutions
New Discussion

Determining process memory and CPU usage

 
SOLVED
Go to solution
Bill McNAMARA_1
Honored Contributor

Determining process memory and CPU usage

Hi,

we all know top, but is there a more complete method to view a processes CPU and memory usage history/average similar to sar?

For example, if my platform is running an application I'd like to find out how much of the CPU it takes over time and how much memory it consumes.

I'd also like to find out where the bottleneck of that application is and if adding memory or CPU will speed it up or if it's a matter of tuning the kernel.

Thanks,
Bill
It works for me (tm)
10 REPLIES 10
Bill McNAMARA_1
Honored Contributor

Re: Determining process memory and CPU usage

just remembered, glance will do it...
can I script glance?

what would be the benefit of using scripted glance versus vmstat or sar?

Later,
Bill
It works for me (tm)
Santosh Nair_1
Honored Contributor

Re: Determining process memory and CPU usage

I don't believe that glance is scriptable, but if you have Measureware on the system, you can configure Application groups and set up Measureware to collect information on the application groups.

Hope this helps.

-Santosh
Life is what's happening while you're busy making other plans

Re: Determining process memory and CPU usage

Bill,

If you have glance, chances are you have measureware which is what you really want to be using...

Type 'mwa status'

If this comes back with something meaningful you have measureware installed.

Whether you are using glance of measureware, if you want to monitor a particular bunch of processes on your system, as a distinct entity you need to define the processes in the file /var/opt/perf/parm - The file is fairly self-explanatory - but by way of example I usually define an Oracle database as:

application = Oracle_PROD_Instance
file = ora_*_PROD,oraclePROD

Now when you restart glance, find the application screen and you will see all your processes monitored as a distcinct group.

This file is also used by measureware - so if you restart the measureware daemons using 'mwa restart all' - it will also start grouping the processes together.

How do you get the info out of measureware? Well if you have PerfView its dead easy - its all GUI driven, and you can just drill down. If you don't have PerfView, you'll have to use the measureware 'extract' command to get at your data - this is fairly complex, but if you run it with no options you do get some help!

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Robin Wakefield
Honored Contributor

Re: Determining process memory and CPU usage

Hi Bill,

measureware can group processes together into application groups, which you can then analyse using extract or perfview. This may be what you want.

Rgds, Robin.

Re: Determining process memory and CPU usage

oops - that parm file example should have been:

application = Oracle_PROD_Instance
file = ora_*_PROD,oraclePROD*



I am an HPE Employee
Accept or Kudo
G. Vrijhoeven
Honored Contributor
Solution

Re: Determining process memory and CPU usage

Hi Bill,

it can be done with glance:

create a config file like:
PRM LOOP PRINT gbl_statdate, ";", gbl_stattime, ",", app_name_prm_groupname, ";", app_cpu_total_util (or any other metrix you like to get)

create a script like this:
glance -adviser_only -syntax config.file -j 600 >> glance.ot 2>error.log

Hope this will help

Gideon
Bill McNAMARA_1
Honored Contributor

Re: Determining process memory and CPU usage

I've got MW/PV installed.. full versions and do like it,
however, I'd like to be able to do easy standard unix scripts.

I'd there and easy way to find pid /mem /cpu..
ie with ps perhaps?
It works for me (tm)

Re: Determining process memory and CPU usage

Bill,

I've a vague memory of an HP presales guy telling me a whole host of reasons why the data that comes out of MeasureWare/Glance is much more accurate and reliable than that you get from top/ps/vmstat/sar etc. It's to do with how the data is gathered - glance and measureware use something called MI - the kernel Measurement Interface, while standard UNIX commands just get a 'snapshot' using system calls such as pstat.

However I'm happy to be proved wrong!

I am an HPE Employee
Accept or Kudo
Volker Borowski
Honored Contributor

Re: Determining process memory and CPU usage

This might be of topic,
but if you have access to a SAP-System anywhere....

SAP uses an own tool called "saposcol" which keeps a 24hour performance database in shared memory. You can query the collector from the commandline.

It is simple to use.
You just start "saposcol" and it runs as a deamon.
You use "saposcol -o" to query all data (also the 24hour history) or "saposcol -m" to get snapshots.

Might be an option, if you have SAP on license, but no professionell monitoring tools on budget.

Volker
harry d brown jr
Honored Contributor

Re: Determining process memory and CPU usage

You can't script glance, but you can collect the data at any level you decide (but make sure you have the disk space for the data collected) and view it with perfview.

live free or die
harry
Live Free or Die