pcp
[Top] [All Lists]

Re: Process network bandwidth usage info

To: Madhu Sudhan R Tera <mst9696@xxxxxxxxxxx>
Subject: Re: Process network bandwidth usage info
From: Mark Goodwin <markgw@xxxxxxx>
Date: Thu, 23 Aug 2001 10:10:22 +1000 (EST)
Cc: pcp@xxxxxxxxxxx
In-reply-to: <Pine.GSO.4.21.0108221244240.8457-100000@pollux.cis.ksu.edu>
Sender: owner-pcp@xxxxxxxxxxx
On Wed, 22 Aug 2001, Madhu Sudhan R Tera wrote:

> Hello all!
> I am currently invovled in load balancing in a beowlf cluster.
> 
> we got stuck at one point where we must know the amount of
> network bandwidth( or number of bytes transferred ) by a process(or 
> to a process). Network bandwidth usage is one of the parameter that
> we use in our load balancing algorithms.

AFAIK the linux kernel does not export (nor even does it keep
counters for) per-process network/socket stats.

> 
> Can anyone throw more light on how we can get info for per-process network
> usage( with socket number)  using PCP 

You'll have to patch the kernel, then add something to the linux PMDA.
This will be non-trivial - you'll have to implement the counters on a
per socket basis, export the per-socket counters to /proc/net/{tcp,udp,raw}
and then in the linux PMDA, correlate this with the sockets open for
each process as reported in /proc/<pid>/fd. Of course there may be
other ways to achieve what you need ...

-- Mark


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