在 linux 中显示磁盘活动的类似 htop 的工具

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/469159/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 16:54:02  来源:igfitidea点击:

an htop-like tool to display disk activity in linux

linuxcommand-lineio

提问by user54579

I am looking for a Linux command-line tool that would report the disk IO activity. Something similar to htopwould be really cool. Has someone heard of something like that?

我正在寻找一个可以报告磁盘 IO 活动的 Linux 命令行工具。类似的东西htop会很酷。有人听说过这样的事情吗?

采纳答案by Egil

You could use iotop. It doesn't rely on a kernel patch. It Works with stock Ubuntu kernel

你可以使用iotop。它不依赖于内核补丁。它适用于股票的 Ubuntu 内核

There is a package for it in the Ubuntu repos. You can install it using

在 Ubuntu 存储库中有一个包。您可以使用安装它

sudo apt-get install iotop

iotop

顶

回答by jpalecek

It is not htop-like, but you could use atop. However, to display disk activity per process, it needs a kernel patch (available from the site).These kernel patches are now obsoleted, only to show per-process network activity an optional module is provided.

它不像 htop,但你可以使用atop但是,要显示每个进程的磁盘活动,它需要一个内核补丁(可从站点获得)。这些内核补丁现已过时,仅提供了一个可选模块来显示每个进程的网络活动。

回答by Egil

Use collectlwhich has extensive process I/O monitoring including monitoring threads.

使用collectl具有广泛的进程 I/O 监控,包括监控线程。

Be warned that there are I/O counters for I/O being written to cache and I/O going to disk. collectlreports them separately. If you're not careful you can misinterpret the data. See http://collectl.sourceforge.net/Process.html

请注意,有 I/O 计数器用于将 I/O 写入缓存和将 I/O 写入磁盘。 collectl分别报告。如果您不小心,您可能会误解数据。见http://collectl.sourceforge.net/Process.html

Of course, it shows a lot more than just process stats because you'd want one tool to provide everything rather than a bunch of different one that displays everything in different formats, right?

当然,它显示的不仅仅是流程统计数据,因为您希望一个工具提供所有内容,而不是一堆以不同格式显示所有内容的不同工具,对吗?

回答by Egil

nmonshows a nice display of disk activity per device. It is available for linux.

nmon很好地显示了每个设备的磁盘活动。它可用于 linux。

? Disk I/O ?????(/proc/diskstats)????????all data is Kbytes per second???????????????????????????????????????????????????????????????
?DiskName Busy  Read WriteKB|0          |25         |50          |75       100|                                                      ?
?sda        0%    0.0  127.9|>                                                |                                                      ?
?sda1       1%    0.0  127.9|>                                                |                                                      ?
?sda2       0%    0.0    0.0|>                                                |                                                      ?
?sda5       0%    0.0    0.0|>                                                |                                                      ?
?sdb       61%  385.6 9708.7|WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWR>                 |                                                      ?
?sdb1      61%  385.6 9708.7|WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWR>                 |                                                      ?
?sdc       52%  353.6 9686.7|WWWWWWWWWWWWWWWWWWWWWWWWWWR   >                  |                                                      ?
?sdc1      53%  353.6 9686.7|WWWWWWWWWWWWWWWWWWWWWWWWWWR   >                  |                                                      ?
?sdd       56%  359.6 9800.6|WWWWWWWWWWWWWWWWWWWWWWWWWWWW>                    |                                                      ?
?sdd1      56%  359.6 9800.6|WWWWWWWWWWWWWWWWWWWWWWWWWWWW>                    |                                                      ?
?sde       57%  371.6 9574.9|WWWWWWWWWWWWWWWWWWWWWWWWWWWWR>                   |                                                      ?
?sde1      57%  371.6 9574.9|WWWWWWWWWWWWWWWWWWWWWWWWWWWWR>                   |                                                      ?
?sdf       53%  371.6 9740.7|WWWWWWWWWWWWWWWWWWWWWWWWWWR    >                 |                                                      ?
?sdf1      53%  371.6 9740.7|WWWWWWWWWWWWWWWWWWWWWWWWWWR    >                 |                                                      ?
?md0        0% 1726.0 2093.6|>disk busy not available                         |                                                      ?
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????