当前位置: 首页 > Linux > 正文

How to identify processes that waiting for disk I/O

Using top command, you can easily find out how much CPU used by each job, However, a process/task I/O waiting is also conclued in CPU usage. So, in some case, CPU actually is not busy but you still see high load on system, some processes are just blocked by I/O, therefore CPU cost is high.

How to identify these processes?

 

The way today I’m going to explain is to find out the processes that are in ‘D’ state.You may wonder, what’s that?

The process state code

Before we get started, let’s review the process state code

Identify process in ‘D’ state by ps command

The process in ‘D’ state are in uninterruptible sleep mode, so we can use Linux ps command shows the process state in 8th column, so here is one way to quickly find out the processes that in ‘D’ state

In above output, you can see not just one process that are blocked by device dm-0, so you can look into more about the device see what’s going on there.

Want repeat the process see if the processes are constantly running on blocked io state

Or

 

In the meantime, you should be able to see iostate command shows high iowait

本文固定链接: http://t.yjsec.com/index.php/2018/03/02/413/ | 下一站

该日志由 admin 于2018年03月02日发表在 Linux 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: How to identify processes that waiting for disk I/O | 下一站

How to identify processes that waiting for disk I/O:等您坐沙发呢!

发表评论

快捷键:Ctrl+Enter