How to get processes’ I/O utilization percentage
Posted on In QATwo notices: 1, a process has only one main thread which is itself. 2, a process has many threads.
Solution 1: Please use taskstats [1] related interfaces, and send TASKSTATS_TYPE_PID and TASKSTATS_TYPE_TGID commands to kernel to get a process’s ‘blkio_delay_total’ parameter for a process with one main thread and a process with threads separately.
Solution 2: instrument kernel to get process’s I/O utilization percentage. See [2] for details.
[1] https://www.kernel.org/doc/Documentation/accounting/
[2] https://github.com/iovisor/bcc