특정 장치 또는 마운트 지점의 읽기 및 쓰기 속도를 모니터링하는 방법

특정 장치 또는 마운트 지점의 읽기 및 쓰기 속도를 모니터링하는 방법

Linux에서 특정 장치 또는 마운트 지점(예: /dev/sdc2마운트할 장치) 의 읽기 및 쓰기 속도를 모니터링하는 방법은 무엇입니까 /mnt/data/?

예를 들어 속도를 MB/s 단위로 표시하고 초당 한두 번 업데이트하려고 합니다.

답변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

답변2

나는 이것이 iostat이러한 목적을 위해 선택한 도구라고 생각합니다. 예:

iostat -d -t -p sdc 1 2

sdc이 명령은 속도 정보를 1초 간격으로 두 번 인쇄합니다.

관련 정보