CPU % usage per PID - Aix

This is a discussion on CPU % usage per PID - Aix ; 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 % ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: CPU % usage per PID

  1. 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


  2. Re: CPU % usage per PID

    On Mar 13, 4:39 pm, kev...@gmail.com wrote:
    > 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


    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.


  3. Re: CPU % usage per PID

    May be you need to investigate tprof

    On Mar 13, 2:57 pm, "Henry" wrote:
    > On Mar 13, 4:39 pm, kev...@gmail.com wrote:
    >
    > > 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

    >
    > 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.




  4. Re: CPU % usage per PID

    On Mar 13, 2:57 pm, "Henry" wrote:
    > On Mar 13, 4:39 pm, kev...@gmail.com wrote:
    >
    > > 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

    >
    > 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.


    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.


  5. 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?

  6. Re: CPU % usage per PID

    ps -euwww | grep pid

+ Reply to Thread