+91 – 7838219999

contact@nitinfotech.com

HomeTech SolutionsLinuxReal-time IOPS Monitoring on Linux: iostat, iotop, dstat & sar

Real-time IOPS Monitoring on Linux: iostat, iotop, dstat & sar

Sunday, September 8, 2024

To check IOPS (Input/Output Operations Per Second) in real-time on a Linux system, you can use several tools, such as iostat, iotop, and dstat. Here’s a brief guide on how to use each of these tools:

1. Using iostat for IOPS Monitoring

The iostat command is part of the sysstat package, which provides various system performance monitoring tools.

Install sysstat

sudo apt-get install sysstat # For Debian/Ubuntu 
sudo yum install sysstat # For CentOS/RHEL

Use iostat

To monitor IOPS in real-time, you can use:

iostat -dx 1

This command will display extended I/O statistics for each device and update every second.

  • -d: Display device utilization report.
  • -x: Display extended statistics.
  • 1: Refresh interval in seconds.

2. Using iotop

iotop is a Python program with a top-like UI used to show I/O usage by processes.

Install iotop

sudo apt-get install iotop # For Debian/Ubuntu 
sudo yum install iotop # For CentOS/RHEL

Use iotop

To monitor I/O in real-time, you can use:

sudo iotop
  • By default, it refreshes every second. You can adjust the refresh interval with the -d option:
sudo iotop -d 1

3. Using dstat

dstat is a versatile resource statistic tool that can display various system resource usages, including I/O statistics.

Install dstat

sudo apt-get install dstat # For Debian/Ubuntu 
sudo yum install dstat # For CentOS/RHEL

Use dstat

To monitor I/O in real-time, you can use:

dstat -d --disk-util --disk-tps
  • -d: Show disk statistics.
  • –disk-util: Show disk utilization.
  • –disk-tps: Show disk transactions per second (IOPS).

4. Using sar

sar is another tool from the sysstat package that can be used to monitor system performance, including IOPS.

Use sar

To monitor IOPS in real-time:

sar -d 1 1
  • -d: Report I/O statistics.
  • 1: Interval in seconds.
  • 1: Number of reports.

Example Commands Summary

  • iostat:
iostat -dx 1
  • iotop:
sudo iotop -d 1
  • dstat:
dstat -d --disk-util --disk-tps
  • sar:
sar -d 1 1

These tools provide different levels of detail and interfaces, allowing you to choose the one that best fits your needs for monitoring IOPS in real-time.