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
|