Skip to contentSkip to conversation

proc net statistics

DISCUSSION Ken O'Brien 3 participants 4 messages Apr 7, 2014 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I was under the impression that statistics reported
in /proc/{$pid}/net/dev were specific to that process, but the values appear to be globals, i.e., identical for all processes.

Is this a bug?

Regards,

Ken

#1 lore raw
Quoted 7 lines · Ken O'Brien

Hi,

I was under the impression that statistics reported
in /proc/{$pid}/net/dev were specific to that process, but the values appear to be globals, i.e., identical for all processes.

Is this a bug?

That is per network-namespace statistics, so it is not a bug.

#3 lore raw
In reply to a message not in the archive
Quoted 3 lines · Ken O'Brien

Ok, so then, is there a way to read per process network statistics in the proc filesystem?

AFAIK, we only have per-socket and per-netdev statistics, there is no per-process one, you probably want to try cgroup, or put these processes into a namespace.

#4 lore raw
Quoted 7 lines · Cong Wang
Quoted 2 lines · Ken O'Brien

Ok, so then, is there a way to read per process network statistics in the proc filesystem?

AFAIK, we only have per-socket and per-netdev statistics, there is no per-process one, you probably want to try cgroup, or put these processes into a namespace.

You can do that with cgroups, e.g. xt_cgroup. Samsung/Tizen OS seems to make use of this ...

https://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=a00e76349f3564bb8129fc0510dfd93248c3084d