OV Performance Management Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

OVPA - how many CPU's is my DB using?

Regular Advisor

OVPA - how many CPU's is my DB using?

[ Edited ]

Hi everyone ..

 

Is there a way to configure OVPA to tell me how many or which CPU's a specfic DB instance or appliacation is using?

 

thanks

Ricardo

 

 

P.S. This thread has been moved from HP-UX > System Administration to OV Performance Management Forum - HP Forums Moderator

 

10 REPLIES
Honored Contributor Honored Contributor

Re: OVPA - how many CPU's is my DB using?

What are you hoping to do with this knowledge?

 

With the way processes are assigned CPU time this is going to be a moving target.  Each DB process, at some point, will likely run on every CPU on the system for some amount of time.  Processes are generally not locked to a specific CPU.

Regular Advisor

Re: OVPA - how many CPU's is my DB using?

Hi Patrick

 

Thanks for the response ..

 

That is what I was also thinking but maybe if I provide addtional detail there is another way to to skin this cat.

 

Basicly we have a DB instance that "paid" for 2 CPU's on a shared server that is hosting other databases.


We want find a way to determine how many CPU's this instance is using.

 

Thanks

Ricardo

 

Honored Contributor Honored Contributor

Re: OVPA - how many CPU's is my DB using?

What you might be able to do is use a ps command with a custom column list to display, among other things, the PCPU (# CPU utilization) for each process.  If you then look specifically for processes related to your specific DB, then you could add up the %CPU column.  If you assume that 2 CPUs = 200% usage, then you can determine if they are going over that amount of usage.

 

For example:

 

# ps -eo user,pid,ppid,pcpu,stime,tty,time,args
USER       PID  PPID  %CPU    STIME TT           TIME COMMAND
root         0     0  0.02  Dec 26  ?           01:37 swapper
root         8     0  0.00  Dec 26  ?           00:00 supsched
root         9     0  0.00  Dec 26  ?           00:00 strmem
root        10     0  0.00  Dec 26  ?           00:00 strweld
root        11     0  0.00  Dec 26  ?           00:00 strfreebd
root         2     0  0.02  Dec 26  ?           00:14 vhand
root         3     0  0.02  Dec 26  ?           11:11 statdaemon
root         4     0  0.02  Dec 26  ?           00:35 unhashdaemon
root        12     0  0.00  Dec 26  ?           00:00 ttisr
root        13     0  0.00  Dec 26  ?           00:00 ioconfigd
root         1     0  0.02  Dec 26  ?           00:49 init
root        19     0  0.02  Dec 26  ?           00:23 lvmkd
root        20     0  0.02  Dec 26  ?           00:24 lvmkd
root        21     0  0.02  Dec 26  ?           00:23 lvmkd
root        22     0  0.02  Dec 26  ?           00:23 lvmkd
root        23     0  0.02  Dec 26  ?           00:24 lvmkd
root        24     0  0.02  Dec 26  ?           00:23 lvmkd
root        25     0  0.02  Dec 26  ?           01:19 lvmschedd
root        26     0  0.02  Dec 26  ?           00:01 smpsched
root        27     0  0.02  Dec 26  ?           00:01 smpsched
root        28     0  0.00  Dec 26  ?           00:00 sblksched
root        29     0  0.00  Dec 26  ?           00:00 sblksched
root        30     0  0.02  Dec 26  ?           00:10 lvmdevd
root        31     0  0.00  Dec 26  ?           00:00 lvmattachd
root      1430     1  0.02  Dec 26  console     00:00 /usr/sbin/getty console console

 

I would have to do some experiments to come up with a way to add up the column with the %CPU values.  I know it can be done, but I don't know the syntax to do it easily.

 

Honored Contributor Honored Contributor

Re: OVPA - how many CPU's is my DB using?

Something like this would sum the 4th column, which is the %CPU column in my ps command:

 

# ps -eo user,pid,ppid,pcpu,stime,tty,time,args | grep monitor | awk '{sum+=$4} END {print sum}'

 

Alter the 'grep' portion to look for your database name, or whatever you desire.

 

 

Regular Advisor

Re: OVPA - how many CPU's is my DB using?

Hi Patrick

 

Im running 11.31 on an rx8640.

 

And I dont have the o optiontion in the ps command..

 

 

# ps -eo user,pid,ppid,pcpu,stime,tty,time,args
ps: illegal option -- o
usage: ps [-edaxzflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup] [-Z psetidlist]

Regular Advisor

Re: OVPA - how many CPU's is my DB using?

I got it

 

UNIX95= ps -eo user,pid,ppid,pcpu,stime,tty,time,args

 

 

Re: OVPA - how many CPU's is my DB using?

as long as there is a clear way to distinguish/identify the processes that enable the db instance you can create an app definition in the parm file (/var/opt/perf/parm - it already contains some examples). Once you configure the app definition in the parm file, restart OVPA (esp scope).
Then, you start getting the APP_CPU_TOTAL_UTIL metric for this app/set of processes - this is a portion of total cpu on the system. so if there are 8 cpu cores and you get 25% utilization, then you have 2 CPU cores being utilized. Pl try it out - using ps command is so passé :).
HPE Software Rocks!
Regular Advisor

Re: OVPA - how many CPU's is my DB using?

I created a report and performed the extract ..

 


02/05/2013|00:00:00| 17.54|
02/05/2013|00:05:00| 11.77|
02/05/2013|00:10:00| 12.91|
02/05/2013|00:15:00| 13.78|
02/05/2013|00:20:00| 10.64|
02/05/2013|00:25:00| 12.70|

 

Is there a way for me to specify the application and also generate this report with a daily total as compared to a 5 minute interval?

 

Re: OVPA - how many CPU's is my DB using?

Glad to know you have come this far.

 

Have a look at the reptfile in /var/opt/perf folder - this determines the metrics that get printed in the extract output.

 

For options, have a look at the manpage for the extract command.

I will get back soon with the right cmd syntax for your need.

 

- RamD

HPE Software Rocks!
Highlighted
Regular Advisor

Re: OVPA - how many CPU's is my DB using?

Thanks ..


There are so many options .. I must be missing something.

 

SUMMARY=1440

 

and also tried -xw for weekly.

 

Still playing around with it but I feel like I am getting close.

 

Also if I use


APP_CPU_TOTAL_UTIL

 

And simply added up all of the 5 minute intervals ..

 

This will tell me the total amount of cpu the app used for that hour ..

 

so if the total is 200.00 and we have a min of 8 cpus alocated with a max of 10 ..

 

that would be the db is using all 10  for that hour?