Linux viewing disk IO in several ways

Source: Internet
Author: User
Tags memory usage sleep cpu usage

How can I quickly navigate to concurrent high because of the large disk IO overhead? There are three ways to:

The first: Using CPU information in the top command to observe

The CPU information that top can see is:

tasks:29 Total, 1 running, sleeping, 0 stopped, 0 zombie

Cpu (s): 0.3% us, 1.0% sy, 0.0% ni, 98.7% ID, 0.0% wa, 0.0% Hi, 0.0% si

The specific explanations are as follows:

Total Process tasks:29

1 running number of processes running

Number of sleeping sleep processes

0 stopped number of processes stopped

0 Zombie Zombie Process number

Cpu (s):

0.3% US user space consumption CPU percent

1.0% sy kernel space occupies CPU percent

0.0% ni% of processes in user process space that have changed priority

98.7% ID Idle CPU percent

0.0% wa% CPU time waiting for input output

0.0% hi

0.0% si

The percentage of 0.0% WA can roughly reflect the frequency of current disk IO requests. If the number of WA is relatively large, it indicates that there are more IO waiting for input and output.

The second type: using Vmstat

The Vmstat command reports statistical information about threads, virtual memory, disks, traps, and CPU activity. Reports generated by the Vmstat command can be used to balance system load activities. The system-wide statistics (in all processors) calculate the average as a percentage, or calculate the sum.

Enter command:

Vmstat 2 5

If you find that the waiting process and the number of processes in the non-interrupted sleep state are very large, and the number of blocks sent to the block and the number of blocks received from the block device is very high, then disk IO is more.

Vmstat parameter Explanation:

Procs

R: Number of processes waiting to run B: number of processes in a non-disruptive sleep state w: The number of running processes that are swapped out. This number is calculated by Linux, but Linux does not run out of swap space

Memory

SWPD: Virtual memory usage, unit: KB

Free: idle memory, per kb

Buff: The amount of memory that is used as a cache, in kilobytes: KB

Swap

Si: The number of swap pages exchanged from disk to memory, in units: kb/seconds

So: number of swap pages from memory to disk, in units: kb/seconds

Io

BI: Number of blocks sent to the block unit: block/sec

Bo: Number of blocks received from block devices, in units: Block/sec

System

In: Number of interrupts per second, including clock interrupts

CS: The number of environment (context) switches per second

Cpu

Show by percent of total CPU usage

Us:cpu Use time

SY:CPU System Usage Time

ID: Idle Time

Quasi-Test

More Vmstat Use information

The second type: using Iostat

Installation:

Iostat is a tool for the Sysstat toolset and needs to be installed.

The CentOS is installed in the following ways:

Yum Install Sysstat

Ubuntu is installed in the following ways:

Aptitude Install Sysstat

Use:

IOSTAT-DX Display disk extension information

root@fileapp:~# IOSTAT-DX

R/S and w/s are read and write operations per second, while the rkb/s and WKB/S columns display the amount of read and write data per second in kilobytes

If these two pairs of data values are high, the disk IO operation is very frequent.

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.