Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use iotop and iostat in Linux to monitor disk iUnix activity

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to use iotop and iostat in Linux to monitor disk Icano activity". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

What is iotop?

Iotop is a top-like tool for displaying real-time disk activity.

Iotop monitors the Imax O usage of the Linux kernel output and displays the current Imax O usage of a process or thread in a system.

It shows the bandwidth of each process / thread read and write Icano. It also shows the percentage of time spent by threads / processes waiting for swapping in and waiting for Igamo.

The values of Total DISK READ and Total DISK WRITE represent the total read and write bandwidth between the process and the kernel thread on the one hand and the kernel block device subsystem on the other.

The values of Actual DISK READ and Actual DISK WRITE represent the actual disk bandwidth corresponding to the kernel block device subsystem and the underlying hardware (HDD, SSD, and so on).

How do I install iotop in Linux?

We can easily install with the help of the package manager because the package is available in all Linux distribution repositories.

For Fedora systems, use the DNF command to install iotop.

$sudo dnf install iotop

For Debian/Ubuntu systems, use the API-GET command or the APT command to install iotop.

$sudo apt install iotop

For Arch Linux-based systems, use Pacman Command to install iotop.

$sudo pacman-S iotop

For RHEL/CentOS systems, use YUM Command to install iotop.

$sudo yum install iotop

For systems that use openSUSE Leap, use Zypper Command to install iotop.

How does sudo zypper install iotop use the iotop command in Linux to monitor disk Imax O activity / statistics?

The iotop command has a number of parameters to check for changes to disk Imax O:

# iotop

ten

If you want to check that that process is actually doing I only O, run the iotop command with the-o or-- output parameter.

# iotop-only

eleven

Details:

IO: it shows the Imax O utilization of each process, including disk and swap.

SWAPIN: it only shows the swap usage for each process.

What is iostat?

Iostat is used to report statistics of central processing units (CPU) and output / output statistics of devices and partitions.

The iostat command monitors the system input / output device load by observing the device active time associated with their average transfer rate.

The reports generated by the iostat command can be used to change the system configuration to better balance the input / output load between physical disks.

All statistics are reported each time the iostat command is run. The report contains a CPU header followed by a line of CPU statistics.

In multiprocessor systems, CPU statistics are calculated as the average of all processors at the system level. The device header line is followed by statistics for each configured device row.

The iostat command generates two types of reports, the CPU utilization report and the device utilization report.

How to install iostat in Linux?

The iostat tool is part of the sysstat package, so we can easily install it with the help of the package manager because it is available in the repositories of all Linux distributions.

For Fedora systems, use DNF Command to install sysstat.

$sudo dnf install sysstat

For Debian/Ubuntu systems, use APT-GET Command or APT Command to install sysstat.

$sudo apt install sysstat

For Arch Linux-based systems, use Pacman Command to install sysstat.

$sudo pacman-S sysstat

For RHEL/CentOS systems, use YUM Command to install sysstat.

$sudo yum install sysstat

For openSUSE Leap systems, use Zypper Command to install sysstat.

How does sudo zypper install sysstat use the sysstat command in Linux to monitor disk Imax O activity / statistics?

There are a number of parameters in the iostat command to check the change statistics about Imax O and CPU.

Run the iostat command without arguments and you will see the complete system statistics.

# iostat Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _ x86 64 _ (8 CPU) avg-cpu:% user% nice% system% iowait% steal% idle 29.45 0.02 16.47 0.12 0.00 53.94 Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscdnvme0n1 6.68 126.95 124.97 0.00 58420014 57507206 0sda 0.18 6.77 80.24 0.00 3115036 36924764 0loop0 0.00 0.00 0.00 2160 0 0loop1 0.00 0.00 0.00 1093 0 0loop2 0.00 0.00 0.00 1077 00

Run the iostat command with the-d parameter to view the Imax O statistics for all devices.

# iostat-d Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _ x86 CPU 648 Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscdnvme0n1 6.68 126.95 124.97 58420030 57509090 0sda 0.18 6.77 80.24 0.00 3115292 36924764 0loop0 0.00 0.00 0.00 2160 0 0loop1 0.00 0.00 0.00 1093 0 0loop2 0.00 0.00 0.00 1077 00

Run the iostat command with the-p parameter to view the Icano statistics for all devices and partitions.

# iostat-p Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _ x86 April 648 CPU avg-cpu:% user% nice% system% iowait% steal% idle 29.42 0.02 16.45 0.12 0.00 53.99 Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_ Dscdnvme0n1 6.68 126.94 124.96 0.00 58420062 57512278 0nvme0n1p1 6.40 124.46 118.36 0.00 57279753 54474898 0nvme0n1p2 0.27 2.47 6.60 0.00 1138069 3037380 0sda 0.18 6.77 80.23 0.00 3116060 36924764 0sda1 0.00 0.01 0.00 0.00 3224 0 0sda2 0.18 6.76 80.23 0.00 3111508 36924764 0loop0 0.00 0.00 0.00 0.00 2160 0 0loop1 0.00 0.00 0.00 1093 0 0loop2 0.00 0.00 0.00 1077 00

Run the iostat command with the-x parameter to display detailed I _ ram O statistics for all devices.

# iostat-x Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _ x86 / 64 _ (8 CPU) avg-cpu:% user% nice% system% iowait% steal% idle 29.41 0.02 16.45 0.00 54.00 Device rkB/s rrqm/s% rrqm r_await rareq-sz wdeband s wkB/s Wrqm/s% wrqm w_await wareq-sz dash s dkB/s drqm/s% drqm d_await dareq-sz aqu-sz% utilnvme0n1 2.45 0.60 19.74 0.40 51.74 4.23 124.96 5.12 54.76 29.54 0.00 0.00 0.00 0.31 30.28sda 0.06 6.77 0.00 0.00 8.34 119.20 0.12 80.23 19.94 99.40 31.84 670.73 0.00 0.00 0.00 0.13loop0 0.00 0.00 0.00 0.08 19.64 0.00 0.00 0.00 0.00loop1 0.00 0.00 0.00 0.40 12.86 0.00 0.00 0.00 0. 00 0.00 0.00 0.00 0.00loop2 0.00 0.00 0.00 0.38 19.58 0.00 0.00 0.00 0.00 0.00 0.00

Run the iostat command with the-d [device name] parameter to see the Imax O statistics for a specific device and its partition.

# iostat-p [Device_Name] # iostat-p sda Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _ x86 CPU 648 avg-cpu:% user% nice% system% iowait% steal% idle 29.38 0.02 16.43 0.12 0.00 54.05 Device tps kB_read/s kB_wrtn/s kB_dscd/s KB_read kB_wrtn kB_dscdsda 0.18 6.77 80.21 0.00 3117468 36924764 0sda2 0.18 6.76 80.21 0.00 3112916 36924764 0sda1 0.00 0.01 0.00 0.00 3224 0 0

Run the iostat command with the-m parameter to view the statistics of all devices in MB instead of KB. The output is displayed in KB by default.

# iostat-m Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _ x86 / 64 _ (8 CPU) avg-cpu:% user% nice% system% iowait% steal% idle 29.36 0.02 16.41 0.12 0.00 54.09 Device tps MB_read/s MB_wrtn/s MB_dscd/s MB_read MB_wrtn MB_ Dscdnvme0n1 6.68 0.12 0.12 0.00 57050 56176 0sda 0.18 0.01 0.08 0.00 3045 36059 0loop0 0.00 0.00 0.00 2 0 0loop1 0.00 0.00 0.00 1 0 0loop2 0.00 0.00 0.00 1 00

Run the iostat command at specific intervals using the following format. In this example, we intend to capture two reports at an interval of five seconds.

# iostat [Interval] [Number Of Reports] # iostat 5 2 Linux 4.19.32-1-MANJARO (daygeek-Y700) Thursday 18 April 2019 _ x86 64 _ (8 CPU) avg-cpu:% user% nice% system% iowait% steal% idle 29.35 0.02 16.41 0.12 0.00 54.10 Device tps kB_read/s kB_wrtn/s kB_dscd/ S kB_read kB_wrtn kB_dscdnvme0n1 6.68 126.89 124.95 0.00 58420116 57525344 0sda 0.18 6.77 80.20 0.00 3118492 36924764 0loop0 0.00 0.00 0.00 2160 0 0loop1 0.00 0.00 0.00 1093 0 0loop2 0.00 0.00 1077 00 avg-cpu:% user% nice% system% iowait% steal% idle 3.71 0.00 2.51 0.05 0.00 93.73 Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read kB_wrtn kB_dscdnvme0n1 19.00 0.20 311.40 0.00 1 1557 0sda 0.20 25.60 0.00 0.00 128 0 0loop0 0.00 0.00 0.00 00 0loop1 0.00 0.00 0.00 00 0loop2 0.00 0.00 0.00 00 0

Run the iostat command with the-N parameter to view the LVM disk Imax O statistics report.

# iostat-N Linux 4.15.0-47-generic (Ubuntu18.2daygeek.com) Thursday 18 April 2019 _ x86mm 642CPU avg-cpu:% user% nice% system% iowait% steal% idle 0.38 0.07 0.18 0.26 0.00 99.12 Device tps kB_read/s kB_wrtn/s kB_read kB_wrtnsda 3.60 57.07 69.06 968729 1172340sdb 0.02 0.33 0.00 5680 0sdc 0.01 0.12 0.00 2108 02g-2gvol1 0.00 0.07 0.00 1204 0

Run the nfsiostat command to view the iUnip O statistics for Network File System (NFS).

# nfsiostat, "how to use iotop and iostat in Linux to monitor disk Icano activity" ends here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report