0Pricing
Linux Command Line Mastery · 강의

디스크 입출력 모니터링: `iostat`, `iotop`

디스크 입력 및 출력 성능을 모니터링하고 분석하여 병목 현상을 식별합니다.

디스크 입출력 모니터링: `iostat`, `iotop`은(는) CoddyKit의 무료 Linux Command Line Mastery 강의입니다. 이것은 4개 중 1번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Linux Command Line Mastery 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Linux Command Line Mastery 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Why Monitor Disk I/O?

Disk Input/Output (I/O) refers to the data moving between your computer's CPU and its storage devices (like hard drives or SSDs).

Monitoring disk I/O is crucial for understanding system performance. Slow disk I/O can be a major bottleneck, making your applications and overall system feel sluggish, even if your CPU and memory are underutilized.

Introducing `iostat`

The iostat command is part of the sysstat package and is used to report CPU statistics and device I/O statistics.

It provides a system-wide view of disk activity, helping you identify if your storage devices are struggling to keep up with demand.

Running iostat without any options gives you a snapshot of current I/O performance.

iostat

Decoding Basic `iostat` Output

A typical iostat output shows several key metrics:

  • Device: The name of the storage device (e.g., sda, nvme0n1).
  • tps: Transfers per second (read + write).
  • kB_read/s: Kilobytes read from the device per second.
  • kB_wrtn/s: Kilobytes written to the device per second.
  • kB_read: Total kilobytes read since boot.
  • kB_wrtn: Total kilobytes written since boot.

These give you a quick overview of the overall data flow.

Advanced `iostat` Metrics

For deeper insights, use iostat -x to see extended statistics. Pay attention to:

  • r/s, w/s: Reads/writes per second (similar to tps, but separated).
  • rkB/s, wkB/s: Read/write kilobytes per second.
  • %util: Percentage of time the device was busy. High %util (near 100%) indicates a potential bottleneck.
  • await: The average time (in milliseconds) for I/O requests issued to the device to be served. This includes time spent in queue and service time.

High await values suggest I/O requests are waiting too long.

iostat -x

Real-time Monitoring with `iostat`

To observe I/O activity over time, you can specify an interval in seconds. This allows you to see how stats change during different workloads.

For example, iostat -d 2 3 will display disk statistics every 2 seconds, for a total of 3 reports. The -d flag limits the output to only disk statistics.

iostat -d 2 3

Focusing on Specific Disks

If you have multiple storage devices, you might want to monitor a specific one. You can append the device name to the iostat command.

For instance, to monitor the sda device with extended statistics every 5 seconds, you would use iostat -x 5 sda.

This helps pinpoint issues on individual drives.

iostat -x 5 sda

Introducing `iotop`

While iostat provides system-wide disk I/O statistics, iotop gives you a more granular, process-level view.

iotop shows which processes are actively performing disk I/O, similar to how top shows CPU usage per process. This is invaluable for identifying specific applications or services hogging disk resources.

iotop

Understanding `iotop` Output

When you run iotop, you'll see a real-time list of processes and their I/O activity. Key columns include:

  • TID/PID: Thread or Process ID.
  • USER: The user owning the process.
  • DISK READ: Current disk read rate of the process.
  • DISK WRITE: Current disk write rate of the process.
  • SWAPIN: Percentage of time spent swapping.
  • IO%: Total I/O percentage for the process.

By default, it sorts by IO%, making it easy to spot I/O-intensive tasks.

Identifying I/O Hogs with `iotop`

iotop is interactive by default, but you can use flags for specific views. For example, iotop -oPa shows only processes with active I/O, aggregated for each process, and non-interactive.

This helps quickly identify which processes are causing high disk activity and potentially impacting overall system performance.

iotop -oPa

Check Your I/O Knowledge

Which iostat metric directly indicates the percentage of time a storage device is busy processing requests?

I/O Monitoring Recap

In this lesson, you've learned how to use two powerful Linux commands for disk I/O monitoring:

  • iostat: Provides system-wide disk I/O statistics, including transfers per second, read/write rates, and crucial metrics like %util (device utilization) and await (request latency). It's great for identifying overall disk bottlenecks.
  • iotop: Offers a real-time, process-level view of disk I/O, helping you pinpoint specific applications or services that are consuming significant disk resources.

Mastering these tools is essential for diagnosing and resolving performance issues related to storage.

자주 묻는 질문

“디스크 입출력 모니터링: `iostat`, `iotop`” 강의는 무료인가요?

네 — “디스크 입출력 모니터링: `iostat`, `iotop`” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Linux Command Line Mastery 강의 전체를 잠금 해제할 수 있습니다. Linux Command Line Mastery 강의에는 총 4개의 강의가 포함되어 있습니다.

“디스크 입출력 모니터링: `iostat`, `iotop`”에서 뭘 배우나요?

디스크 입력 및 출력 성능을 모니터링하고 분석하여 병목 현상을 식별합니다. 브라우저에서 직접 실행하는 실습 코드로 Linux Command Line Mastery을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Linux Command Line Mastery을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Linux Command Line Mastery은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 1번째 강의입니다.

“디스크 입출력 모니터링: `iostat`, `iotop`” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Linux Command Line Mastery 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Linux Command Line Mastery 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 디스크 입출력 모니터링: `iostat`, `iotop`
  2. 메모리 및 CPU 성능 도구
  3. 고급 로그 기록 및 문제 해결 기법
  4. strace와 ltrace로 시스템 호출 추적하기
← Linux Command Line Mastery(으)로 돌아가기