I'm currently developing an application in Linux which needs to classify some processes as network I/O bound or memory bound at runtime. Instead of using some tool such as iotop, I need to identify whether a process is network I/O bound or not in my code. I tried to use the information available through /proc, but I can not find network I/O statistics there. So, are there any other ways I can get network I/O statistics of a process? Any help would be greatly appreciated!
Try to cat /proc/pid/io
at a certain frequence.
And delta write/read bytes tell whether the pid is I/O bound. (Of course according to your own benchmark.)
link to similar question
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With