Iostat command Simple to use

Source: Internet
Author: User

1.iostat Range of Use

The Iostat command can generate 3 types of reports:

(1) Report on CPU usage

(2) Report on equipment usage

(3) Report on network File System (NFS) usage

2. Format description for each type of report

explanation of the format of the CPU Usage report :

%user: The percentage of time the application uses the CPU.

%nice: The percentage of time that a high-priority application consumes CPU.

By default, all applications have the same priority, so the CPU does not favor whichever. But if there is a high priority, the CPU will first

To execute them, then for this group of special applications, we use%nice to count their CPU usage ratios.

%system: The percentage of time that the kernel program uses the CPU.

%iowait: How much time the CPU spends waiting for disk IO. At this time the CPU is idle and nothing is done.

%idle: The CPU does nothing, neither waits for disk IO, nor does anything else. Full idle state.

%steal: Before the Management Program service in CPU1, suddenly CPU2 ran, at this time management program with CPU1 said: You wait will ha, I first go to service CPU2, immediately back.

At this point, CPU1 is forced to be placed in a wait state. The CPU1 waiting time ratio is%steal. (Personal understanding)

Explanation of the format of the Device usage report:

TPS: The number of transmissions sent to the device per second. The transmission here refers to an I/O request sent to the device.

So, TPS means: the number of I/O requests sent to the device per second . A read request is called a i/0, and a write request is called an I/O.

blk_read/s: number of blocks read from the device per second . The size of each block is 512 bytes, equal to the size of a sector.

BLK_WRTN/S: number of blocks written to the device per second . The size of each block is 512 bytes, equal to the size of a sector.

blk_read: The total number of blocks read from the device . Number of blocks sent out.

Blk_wrtn: The total number of blocks written to the device . Number of blocks brought in.

kb_read/s: The number of kilobytes per second read from the device . Kilobytes.

KB_WRTN/S: The number of kilobytes written to the device per second . Kilobytes.

Kb_read: The total number of kilobytes read from the device . Kilobytes. The amount of data sent out.

Kb_wrtn: The total number of kilobytes written to the device . Kilobytes. The amount of data taken in.

mb_read/s: The number of megabytes per second read from the device . Megabytes.

MB_WRTN/S: The number of megabytes per second written to the device . Megabytes.

Mb_read: The total number of megabytes read out from the device .

Mb_wrtn: The total number of megabytes written to the device .

RRQM/S: No understanding, will look for information to supplement.

WRQM/S: No understanding, will look for information to supplement.

r/s: The number of read requests sent to the device per second . (Important indicators)

w/s: The number of write requests sent to the device per second . (Important indicators)

rsec/s: How many sectors are read from this device per second.

wsec/s: The number of sectors written to the device per second.

rkb/s: The number of kilobytes per second read from the device. Kilobytes. (same as the previous kb_read/s)

wkb/s: The number of kilobytes written to the device per second. Kilobytes. (same as the previous kb_write/s)

rmb/s: Similar to the above.

wmb/s: Similar to the above.

Avgrq-sz: All requests sent to the device are of a size. This parameter is used to represent the average size of all requests , in sector units.

Avgqu-sz: If the first 1 seconds, the request queue in front of the device has 5 requests, and the 2nd second, the queue in front of the device has 4 requests;

The 3rd second, the request queue in front of the device has 3 requests, then I will calculate, the queue before the device, the average per second is how long:

5 + 4 + 3/3 = 4. That is, the average of 4 requests per second is queued.

await: The average time that the device serves each request . Includes the queued time of the request and the actual service time. Like I go to KFC,

There were 4 people in front of me, and after 15 minutes, the waiter began to serve me. I ordered a hamburger and a Coke.

For 5 minutes, the waiter handed the hamburger and coke to me, and I took the thing and left. So for me this person (request),

KFC's service time is 20 minutes. the unit is in milliseconds .

SVCTM: This field will be removed in a future Sysstat installation package. So there's no need to pay attention. (Our iostat is from Sysstat this installation package)

%util: No understanding, will look for information to supplement.

About Network File system reports:

The NFS client mounts devices shared by the NFS server, and we can count our use of NFS on the NFS client.

Filesystem: Refers to the network file system. can be represented by IP: directory or hostname: directory.

For example:10.10.10.10:/data/image or img.example.com:/data/image.

RBLK_NOR/S: The application through the read () This system call interface, the number of blocks read from the network file system, the size of a block is 512 bytes.

WBLK_NOR/S: The application writes to the number of blocks in the network file system through the write () system calling interface.

RBLK_DIR/S: The number of blocks we read from an open file . This file is in the network file system and is opened with the o_direct tag.

WBLK_DIR/S: The number of blocks we write to an open file . This file is in the network file system and is opened with the o_direct tag.

The number of blocks read from the server by the RBLK_SVR/S:NFS client through an NFS read request.

The number of blocks that the WBLK_SVR/S:NFS client writes to the Server through NFS write requests.

RKB_NOR/S: The application reads the number of kilobytes from the network file system via the read () system call interface. Kilobytes.

WKB_NOR/S: The application writes to the number of kilobytes in the network file system through the write () system calling interface. Kilobytes.

RKB_DIR/S: The number of kilobytes that we read from an open file . This file is in the network file system and is opened with the o_direct tag.

WKB_DIR/S: The number of kilobytes that we write to an open file . This file is in the network file system and is opened with the o_direct tag.

Rkb_svr/s:nfs the number of kilobytes that the client reads from the server through an NFS read request.

Wkb_svr/s:nfs the number of kilobytes that the client writes to the server through an NFS write request.

RMB_NOR/S: Ditto, just changed the unit.

WMB_NOR/S: Ditto, just changed the unit.

RMB_DIR/S: Ditto, just changed the unit.

WMB_DIR/S: Ditto, just changed the unit.

RMB_SVR/S: Ditto, just changed the unit.

WMB_SVR/S: Ditto, just changed the unit.

OPS/S: The number of operations initiated per second to the file system.

ROPS/S: Number of read operations initiated per second to the file system.

WOPS/S: Number of write operations to the file system per second.

In general, the routine is:block number, kilobytes, megabytes.

3. Command options

Iostat-c only show CPU usage

iostat-d Only show device usage

Iostat-n only Show Network File system usage

Iostat-k in kilobytes, without K, is displayed as a block number

The iostat-m is displayed in megabytes, with no m, as block numbers.

Iostat-n useful when viewing LVM2

Iostat-j {ID | LABEL | PATH | UUID} [Device | All] did not understand, unknown origin information.

iostat-p [{Device | All}] Displays statistics about the block device and its partition statistics, such as the SDA block device and its partition sda1.

IOSTAT-T displays the time of each print

Iostat-v print version of Sysstat

Iostat-x displaying extended statistics, reference to/proc/diskstat files and/proc/partions files

Iostat-y ignores the first report (the first statistic is calculated from the start of the system) and is displayed from the second start

Iostat-z ignores device statistics that do not have any activity during the sampling period. That is, if the device does not have any write and read, then it is not necessary to count its data

4. Precautions

The/proc file system must be mounted on the iostat before it can work.

SVCTM: Average service time, this field will be meaningless later. because I/O statistics are computed at the block level, we do not know when the disk drive starts processing a request .

5. Attaching files

/proc/stat contains system statistics.

/proc/uptime contains the system run time.

/proc/diskstats contains disk statistics.

/sys contains statistical data for block devices.

/proc/self/mountstats contains statistical data for the network file system.

/dev/disk contains persistent device name

6. Other Reference commands

Sar

Pidstat

Mpstat

Vmstat

Iostat command Simple to use

Related Article

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.