pcp
[Top] [All Lists]

Re: getting the currently running process metrics

To: Madhu Sudhan R Tera <mst9696@xxxxxxxxxxx>
Subject: Re: getting the currently running process metrics
From: Ken McDonell <kenmcd@xxxxxxxxxxxxxxxxx>
Date: Fri, 6 Jul 2001 05:47:37 +1000
Cc: <pcp@xxxxxxxxxxx>
In-reply-to: <Pine.GSO.4.21.0107051202530.22088-100000@xxxxxxxxxxxxxxxxxx>
Reply-to: <kenmcd@xxxxxxx>
Sender: owner-pcp@xxxxxxxxxxx
On Thu, 5 Jul 2001, Madhu Sudhan R Tera wrote:

> Hello all!
> I am new to this mailing list!

Welcome.

> Currently i am working on load balancing in beowulf cluster.
>
> The proposed procedure is to get the metrics for all the running
> processes from PCP and provide these metrics as input to the loadbalancing
> algorithm, which evaluates these metrics and decides which process to be
> migrated.

Seems like a reasonable fit with PCP's capabilities.

> But I dont find any facility to get the process metrics like CPU usage by
> each running process or memorey required by each process.pmem tool is not
> available in non-commercial versions of PCP,i guess!

The reason pmem is not there is that compared to IRIX, Linux does not export 
the same
(nor as detailed) information about the address space of each process.

But there are some stats ... check out

    pminfo -dT proc.memory

Similarly the CPU usage stats are covered by

    pminfo -dT proc.psinfo.utime proc.psinfo.stime proc.psinfo.cutime \
            proc.psinfo.cstime

To get a feel for the numbers and the amount of information, use -f
with pminfo in place of -dT.

> Please tell me how i can get the process metrics programmatically using
> pcp libraries.DO i have to write a PMDA or PMAPI??

I expect you will need to write a client program that uses the PMAPI to
connect to PMCD and fetch the desired proc.* metrics for each process
... if you are interested in _recent_ CPU usage then you'll have to
include periodic fetching or fetch-sleep-fetch because the CPU usage
metrics are free-running counters that return CPU time used since the
process began ... pmclient and pmstat are examples of programs that
fetch a small number of metrics using the PMAPI, I'd suggest using
pmclient as source reference.



<Prev in Thread] Current Thread [Next in Thread>