首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何监控特定设备或安装点的读写速度

如何监控特定设备或安装点的读写速度
EN

Unix & Linux用户
提问于 2020-07-31 16:12:18
回答 2查看 1.5K关注 0票数 0

如何监视Linux中特定设备或挂载点的读写速度,例如挂载到/mnt/data/D1

希望以MB/s为例显示速度,并每秒钟更新一次或两次。

EN

回答 2

Unix & Linux用户

发布于 2020-07-31 19:15:40

iostat是真理的来源,尤其是用例的iostat -md /dev/devicename 1

-m Display statistics in megabytes per second.

-z Tell iostat to omit output for any devices for which there was no activity during the sample period.

代码语言:javascript
复制
root@kahnbox:/home/kahn$ iostat -md /dev/sda 1
Linux 5.4.17-100.fc30.x86_64 (kahnbox)  31/07/20        _x86_64_        (4 CPU)

Device             tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
sda               4.61         0.00         0.12       2521     152976

Device             tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
sda               3.00         0.00         0.04          0          0

Device             tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
sda               0.00         0.00         0.00          0          0

tps: Indicate the number of transfers per second that were issued to the device. A transfer is an I/O request to the device. Multiple logical requests can be combined into a single I/O request to the device. A transfer is of indeterminate size.

我更喜欢-z标志,因为它会减少聊天。在命令的末尾包含一个1,只要能够提供结果,您就可以每秒钟得到结果。

如果您希望安装此实用程序,则需要获取sysstat包:

代码语言:javascript
复制
root@kahnbox:/home/kahn$ yum whatprovides iostat                                                                                                                                                                                                                                                                             
Last metadata expiration check: 1:32:20 ago on Fri 31 Jul 2020 13:44:22 EDT.
sysstat-11.7.3-3.fc30.x86_64 : Collection of performance monitoring tools for Linux
Repo        : @System
Matched from:
Filename    : /usr/bin/iostat

sysstat-11.7.3-3.fc30.x86_64 : Collection of performance monitoring tools for Linux
Repo        : fedora
Matched from:
Filename    : /usr/bin/iostat
票数 1
EN

Unix & Linux用户

发布于 2020-07-31 16:30:39

我认为iostat是实现这一目的的首选工具。示例:

代码语言:javascript
复制
iostat -d -t -p sdc 1 2

此命令以间隔为1秒,两次打印有关sdc速度的信息。

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/602251

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档