Linux 如何找到经常做io的进程?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5167794/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to find the process that is doing io frequently?
提问by cheng
I am using ubuntu. There are some processes that are doing io frequently on my server, even a "ls" command will cost 1 second to execute. I want to find out which process is doing io so heavily, is there any good command or tool?
我正在使用 ubuntu。我的服务器上有一些进程经常执行 io,即使是“ls”命令也会花费 1 秒来执行。我想知道哪个进程在做io这么重,有什么好的命令或工具吗?
Thanks.
谢谢。
采纳答案by ?imon Tóth
You can use iotop
to find processes that are io heavy.
您可以使用iotop
来查找 io 繁重的进程。
回答by Petri Lehtinen
回答by Maxim Egorushkin
回答by dogbane
A quick way is to look at the /proc/[PID]/io
file.
一个快速的方法是查看/proc/[PID]/io
文件。
Example:
例子:
$ cat /proc/1944/io
read_bytes: 17961091072
write_bytes: 8192000
cancelled_write_bytes: 32768
回答by apporc
you can try pidstat. I found it useful when i need to identify which process made high io.
你可以试试pidstat。当我需要确定哪个进程产生高 io 时,我发现它很有用。