iostat

Ubuntu 22.04 LTS

$ sudo apt update && sudo apt upgrade
$ sudo apt install sysstat
  • iostat Get report and statistic.
  • iostat -x Show more details statistics information.
  • iostat -c Show only the cpu statistic.
  • iostat -d Display only the device report.
  • iostat -xd Show extended I/O statistic for device only.
  • iostat -k Capture the statistics in kilobytes or megabytes.
  • iostat -k 2 3 Display cpu and device statistics with delay.
  • iostat -j ID mmcbkl0 sda6 -x -m 2 2 Display persistent device name statistics.
  • iostat -p Display statistics for block devices.
  • iostat -N Display lvm2 statistic information.
$ iostat
  • %user is CPU utilization for the user,
  • %nice is the CPU utilization for apps with nice priority,
  • %system is the CPU being utilized by the system,
  • %iowait is the time percentage during which CPU was idle but there was an outstanding i/o request,
  • %steal percentage of time CPU was waiting as the hypervisor was working on another CPU,
  • %idle is the percentage of time system was idle with no outstanding request.

Devices, shows the name of all the devices on system,

  • Tps, is the short for transfer per second,
  • Blk_read/s & Blk_write/s are the transfer speed for read and write operations,
  • Blk_read & Blk_write shows the total number of blocks read & written.

Generate only CPU stats

$ iostat -c

To Generate i/o statistics for all the devices (-d option)

$ iostat -d

Generate detailed i/o statistics

$ iostat -x
$ iostat -cx
$ iostat -dx

Getting i/o statistics for a single device

$ iostat -p sda

Generate reports in either MB or KB

$ iostat -h -p sda
$ iostat -k -p sda
$ iostat -m -p sda

Generating system i/o statistics report with delay

$ iostat 5 3

we are capturing 3 reports at 5 seconds interval

Generate the LVM statistics report

$ iostat -N

Generate the reports for only active devices

$ iostat -z 3 9

Generate iostat reports with timestamp

$ iostat -t
Licensed under CC BY-NC-SA 4.0
comments powered by Disqus