如何监视Linux中特定设备或挂载点的读写速度,例如挂载到/mnt/data/的D1?
希望以MB/s为例显示速度,并每秒钟更新一次或两次。
发布于 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.
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 0tps: 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包:
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发布于 2020-07-31 16:30:39
我认为iostat是实现这一目的的首选工具。示例:
iostat -d -t -p sdc 1 2此命令以间隔为1秒,两次打印有关sdc速度的信息。
https://unix.stackexchange.com/questions/602251
复制相似问题