View linux server hard disk I/O read/write Load

Source: Internet
Author: User
Article Title: View linux server hard disk I/O read/write load. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

An exception occurred on a linux Server recently, and the system was slow to reflect. The corresponding applications could not be reflected, and the server crashed. After several days of observation, we found that the server was under great pressure, the main stress is that hard disk I/O access has reached 100%.

To help you solve such problems as soon as possible, I will share with you the methods for linux server hard disk I/O access load:

First, use the top command to view

Top-16:15:05 up 6 days, 2 users, load average: 1.45, 1.77, 2.14

Task: 147 total, 1 running, 146 sleeping, 0 stopped, 0 zombie

Cpu (s): 0.2% us, 0.2% sy, 0.0% ni, 86.9% id, 12.6% wa, 0.0% hi, 0.0% si

Mem: 4037872 k total, 4003648 k used, 34224 k free, 5512 k buffers

Swap: 7164948 k total, 629192 k used, 6535756 k free, 3511184 k cached

View 12.6% wa

Percentage of CPU time occupied by I/O wait, which is higher than 30%

Next, use iostat-x 1 10

If iostat does not exist, yum install sysstat is required.

Avg-cpu: % user % nice % sys % iowait % idle

0.00 0.00 0.25 33.46 66.29

Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm % util

Sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

Sdb 0.00 1122 17.00 9.00 192.00 9216.00 96.00 4608.00 123.79 137.23 1033.43 13.17 100.10

Sdc 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

View % util 100.10% idle 66.29

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.

When the idle is less than 70% I/O, the load is high. Generally, the read speed is wait.

At the same time, you can view the parameters B with vmstat (number of processes waiting for resources)

Vmstat-1

If you want to perform an I/O load test on the hard disk, run the following command:

Time dd if =/dev/zero bs = 1 M count = 2048 of = direct_2G

This command creates a 2 GB file in the current directory.

We can test the IO load while creating a folder.

Run the following script to check the process I/O at the peak.

Monitor_io_stats.sh

#! /Bin/sh

/Etc/init. d/syslog stop

Echo 1>/proc/sys/vm/block_dump

Sleep 60

Dmesg | awk '/(READ | WRITE | dirtied)/{process [$1] ++} END {for (x in process )\

Print process [x], x} '| sort-nr | awk' {print $2 "" $1} '| \

Head-n 10

Echo 0>/proc/sys/vm/block_dump

/Etc/init. d/syslog start

Or use the iodump. pl script.

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.