Linux iostat command instance details

Source: Internet
Author: User

Linux iostat command instance details

1 command Introduction

In Linux, iostat is short for I/O statistics (input/output statistics). The iostat tool monitors disk operation activities of the system. It reports disk activity statistics and CPU usage. Like vmstat, iostat also has a weakness, that is, it cannot conduct in-depth analysis on a process, but only analyzes the overall situation of the system. Iostat belongs to the sysstat software package. You can directly install sysstat using yum install.

RH442 strategy-iostat

Use the iostat command in Linux to generate a statistical report on CPU and I/O

Install iostat and mpstat

Brief description of Linux iostat command output

Linux iostat command

1.1 command format:

Iostat [parameter] [time] [times]

1.2 command functions:

Iostat allows you to easily view the activity and load information of devices such as CPU, Nic, tty device, disk, CD-ROM, etc.

1.3 command parameters:

-C: CPU usage

-D: Display disk usage

-K is displayed in KB.

-M is displayed in MB.

-N: Display disk array (LVM) Information

-N: displays NFS usage

-P [disk]: displays the disk and partition information.

-T display terminal and CPU Information

-X: displays details.

-V: display version information

2. Example:

2.1 instance 1: displays the load of all devices

Command: iostat

Output:

[Root @ CT1186 ~] # Iostat

Linux 2.6.18-128. el5 (CT1186) February August 23, 2013

Avg-cpu: % user % nice % system % iowait % steal % idle

8.30 0.02 5.07 0.17 0.00 86.44

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn

Sda 22.73 43.70 487.42 674035705 7517941952

Sda1 0.00 0.00 0.00 2658

Sda2 0.11 3.74 3.51 57721595

Sda3 0.98 0.61 17.51 9454172

Sda4 0.00 0.00 0.00 6 0

Sda5 6.95 0.12 108.73 1924834

Sda6 2.20 0.18 31.22 2837260

Sda7 12.48 39.04 326.45 602094508

Note:

Cpu attribute value description:

% User: Percentage of CPU time in user mode.

% Nice: Percentage of CPU time in user mode with NICE value.

% System: Percentage of CPU time in system mode.

% Iowait: Percentage of CPU waiting for input/output completion time.

% Steal: Percentage of unconscious waiting time of the virtual CPU when the hypervisor maintains another virtual processor.

% Idle: Percentage of idle CPU time.

NOTE: If % iowait is too high, it indicates that the hard disk has an I/O bottleneck and % idle is too high, indicating that the CPU is idle. If % idle is too high but the system response is slow, it may be that the CPU waits for memory allocation. In this case, the memory capacity should be increased. If the value of % idle is lower than 10, the CPU processing capability of the system is relatively low, indicating that the most important resource to be solved in the system is the CPU.

Description of disk attribute values:

Rrqm/s: the number of merge read operations per second. Rmerge/s

Wrqm/s: Number of write operations performed on merge per second. That is, wmerge/s

R/s: The number of read I/O devices per second. That is, rio/s

W/s: the number of write I/O devices completed per second. That is, wio/s

Rsec/s: Number of read sectors per second. Rsect/s

Wsec/s: Number of write sectors per second. That is, wsect/s

RkB/s: the number of bytes read per second. It is half of rsect/s because the size of each slice is 512 bytes.

WkB/s: the number of K bytes written per second. Half of wsect/s.

Avgrq-sz: average data size (slice) of each device I/O operation ).

Avgqu-sz: Average I/O queue length.

Await: average wait time (in milliseconds) for each device I/O operation ).

Svctm: Average service time (in milliseconds) for each device I/O operation ).

% Util: the percentage of cpu consumed by I/O operations in one second.

NOTE: If % util is close to 100%, it indicates that too many I/O requests are generated and the I/O system is fully loaded. This disk may have a bottleneck. If svctm is close to await, it means that I/O has almost no waiting time. If await is much larger than svctm, it means that the I/O queue is too long and the io response is too slow, and necessary optimization is required. If avgqu-sz is large, it also indicates that there is an equivalent io waiting.

2.2 instance 2: all information is displayed at regular intervals.

Command: iostat 2 3

Output:

[Root @ CT1186 ~] # Iostat2 3

Linux 2.6.18-128. el5 (CT1186) February August 23, 2013

Avg-cpu: % user % nice % system % iowait % steal % idle

8.30 0.02 5.07 0.17 0.00 86.44

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn

Sda 22.73 43.70 487.42 674035705 7517947296

Sda1 0.00 0.00 0.00 2658

Sda2 0.11 3.74 3.51 57721595

Sda3 0.98 0.61 17.51 9454172

Sda4 0.00 0.00 0.00 6 0

Sda5 6.95 0.12 108.73 1924834

Sda6 2.20 0.18 31.22 2837260

Sda7 12.48 39.04 326.44 602094508

 

Avg-cpu: % user % nice % system % iowait % steal % idle

8.88 0.00 7.94 0.19 0.00 83.00

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn

Sda 6.00 0.00 124.00 0 248

Sda1 0.00 0.00 0.00 0 0

Sda2 0.00 0.00 0.00 0 0

Sda3 0.00 0.00 0.00 0 0

Sda4 0.00 0.00 0.00 0 0

Sda5 0.00 0.00 0.00 0 0

Sda6 0.00 0.00 0.00 0 0

Sda7 6.00 0.00 124.00 0 248

 

Avg-cpu: % user % nice % system % iowait % steal % idle

9.12 0.00 7.81 0.00 0.00 83.07

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn

Sda 4.00 0.00 84.00 0 168

Sda1 0.00 0.00 0.00 0 0

Sda2 0.00 0.00 0.00 0 0

Sda3 0.00 0.00 0.00 0 0

Sda4 0.00 0.00 0.00 0 0

Sda5 0.00 0.00 0.00 0 0

Sda6 4.00 0.00 84.00 0 168

Sda7 0.00 0.00 0.00 0 0

Note:

Refresh the display every 2 seconds and display it three times

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • 3
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.