-
CPU % usage per PID
Does anyone know the best way to get the most granular CPU % for a
given PID? I have been testing with ps on AIX and it seems to cache
the CPU information. No matter how much the CPU % changes (monitoring
with topas), the ps output always displays the same CPU % as I keep
rerunning the command. I am using something like "ps aeux PID".
I need a solution that returns exact CPU % for a given PID as this is
being used in a larger script.
Thanks for any suggestions.
-Kevin
-
Re: CPU % usage per PID
On Mar 13, 4:39 pm, kev...@gmail.com wrote:[color=blue]
> Does anyone know the best way to get the most granular CPU % for a
> given PID? I have been testing with ps on AIX and it seems to cache
> the CPU information. No matter how much the CPU % changes (monitoring
> with topas), the ps output always displays the same CPU % as I keep
> rerunning the command. I am using something like "ps aeux PID".
>
> I need a solution that returns exact CPU % for a given PID as this is
> being used in a larger script.
>
> Thanks for any suggestions.
>
> -Kevin[/color]
not sure if this is what you're after
ps -e -o pid,ppid,pcpu,etime,time,vsz,user,rssize,comm
I have a process monitoring script I'm working on, but it may be
different from what you're looking for. My angle is a java (hoik,
spit) memory leak/usage issue.
-
Re: CPU % usage per PID
May be you need to investigate tprof
On Mar 13, 2:57 pm, "Henry" <snogfest_hosebe...@yahoo.com> wrote:[color=blue]
> On Mar 13, 4:39 pm, kev...@gmail.com wrote:
>[color=green]
> > Does anyone know the best way to get the most granular CPU % for a
> > given PID? I have been testing with ps on AIX and it seems to cache
> > the CPU information. No matter how much the CPU % changes (monitoring
> > with topas), the ps output always displays the same CPU % as I keep
> > rerunning the command. I am using something like "ps aeux PID".[/color]
>[color=green]
> > I need a solution that returns exact CPU % for a given PID as this is
> > being used in a larger script.[/color]
>[color=green]
> > Thanks for any suggestions.[/color]
>[color=green]
> > -Kevin[/color]
>
> not sure if this is what you're after
> ps -e -o pid,ppid,pcpu,etime,time,vsz,user,rssize,comm
>
> I have a process monitoring script I'm working on, but it may be
> different from what you're looking for. My angle is a java (hoik,
> spit) memory leak/usage issue.[/color]
-
Re: CPU % usage per PID
On Mar 13, 2:57 pm, "Henry" <snogfest_hosebe...@yahoo.com> wrote:[color=blue]
> On Mar 13, 4:39 pm, kev...@gmail.com wrote:
>[color=green]
> > Does anyone know the best way to get the most granular CPU % for a
> > given PID? I have been testing with ps on AIX and it seems to cache
> > the CPU information. No matter how much the CPU % changes (monitoring
> > with topas), the ps output always displays the same CPU % as I keep
> > rerunning the command. I am using something like "ps aeux PID".[/color]
>[color=green]
> > I need a solution that returns exact CPU % for a given PID as this is
> > being used in a larger script.[/color]
>[color=green]
> > Thanks for any suggestions.[/color]
>[color=green]
> > -Kevin[/color]
>
> not sure if this is what you're after
> ps -e -o pid,ppid,pcpu,etime,time,vsz,user,rssize,comm
>
> I have a process monitoring script I'm working on, but it may be
> different from what you're looking for. My angle is a java (hoik,
> spit) memory leak/usage issue.[/color]
Thanks Henry. I actually ended up using "ps -p $pid -o
"pcpu,time,cpu"" which gives me the percentage, total CPU time, and
current cpu usage.
-
Re: CPU % usage per PID
> I have a process monitoring script I'm working on, but it may be
> different from what you're looking for. My angle is a java (hoik,
> spit) memory leak/usage issue.[/color][/QUOTE]
How much Java have you written, moron?
-
Re: CPU % usage per PID