Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Linux, how to classify a process as I/O bound or memory bound at runtime?

Tags:

linux

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!

like image 855
Jenson Avatar asked Nov 08 '22 14:11

Jenson


1 Answers

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

like image 110
TanakaYasen Avatar answered Nov 15 '22 07:11

TanakaYasen