特定のデバイスまたはマウントポイントの読み書き速度を監視する方法

特定のデバイスまたはマウントポイントの読み書き速度を監視する方法

Linuxで特定のデバイスまたはマウントポイント(/dev/sdc2マウントするデバイスなど)の読み書き速度を監視する方法は/mnt/data/

たとえば、速度を MB/s 単位で表示し、1 秒あたり 1 回または 2 回更新したいとします。

ベストアンサー1

iostatiostat -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          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パッケージを入手する必要があります。

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

おすすめ記事