View the system's I/O using the Iostat command while using Iotop to sort through I/O statistics and trace to a detailed process

Source: Internet
Author: User

When I see the CPU time of I/O waiting time is very high, the first thing to check is whether the machine is using a lot of swap space, because the speed of hard disk operation is much lower than RAM. So when the system is running out of memory, start using swap space. The performance of the system can be severely impacted.

No matter what you want to access the hard disk operation is finished with the hard disk I/O exchange. So, the first step in troubleshooting is to see if the memory is exhausted, assuming it is. Solve the problem first. Assuming there is a lot of RAM available, you need to understand that the process is taking up most of the I/O operations.

It is very difficult for you to figure out exactly which process is consuming a large amount of I/O resources. Use Iostat to find out which partition is running a large number of I/O operations.

Use of Iostat

The top display is the 1 cpu,64 bit system, the Linux kernel version number

AVG-CPU segment:
%user: Percentage of CPU used at User level execution
Percentage of CPU used by the%nice:nice operation
%system: Percentage of CPU used at System level (kernel) execution
%iowait:cpu CPU percentage consumed while waiting for hardware I/O
%IDLE:CPU Spare% of time
Device segment:

SDA: Device Name
TPS: The number of I/O requests sent per second.
BLK_READ/S: Amount of data read per second
BLK_WRTN/S: The amount of data written per second.
Blk_read: Total amount of data read in
BLK_WRTN: The total amount of data written

Iostat each of the parameters description:


-C displays only CPU statistics. The-D option is mutually exclusive.
-D displays only disk statistics. The and-c option is mutually exclusive.
-K Displays the number of disk requests per second, in the default block of units, in units.
-P Device | All
is mutually exclusive with the-X option to display statistics for block devices and system partitions. You can also specify a device name after-p, such as:
# iostat-p HDA
or Show All devices
# iostat-p All
-T prints the time to collect data when outputting data.
-V print version and help information.
-X Output extension information.

Add a number after Iostat

Iostat 4 indicates a refresh every 4 seconds

Use of Iotop



--version display version and exit
-H,--help Show help and then exit
-O,--only only shows the process or thread that is generating I/O. In addition to the transfer of participation. Can press O to take effect during execution.
-B,--batch non-interactive mode. Typically used to record logs
-N NUM,--iter=num sets the number of times to be measured, by default unlimited. Very useful in non-interactive mode
-D SEC,--delay=sec sets the interval for each monitor. The default is 1 seconds. Accept non-cosmetic data such as 1.1
-P PID,--pid=pid specifies the process/thread to monitor
-u user,--user=user specifies to monitor the I/O generated by a user
-P,--processes show only processes, default Iotop show All Threads
-A,--accumulated displays cumulative I/O. Rather than bandwidth
-K,--kilobytes use KB units. Rather than a person-friendly unit.

In non-interactive mode, script programming is practical.


-T,--time plus time stamp. Non-interactive non-modal.


-Q,--quiet prohibits the first few lines, non-interactive mode. There are three ways of specifying it.


-q Displays column names only on first monitor
-QQ never display column names.
-QQQ never displays I/O rollups.


View the system's I/O using the Iostat command while using Iotop to sort through I/O statistics and trace to a detailed process

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.