Linux Disk Performance monitoring

Source: Internet
Author: User
Tags disk usage

Linux for viewing process commands are also very powerful, commonly used such as: PS Top

But there is less uniformity in disk performance monitoring.

Here are some of the disk monitoring commands, here just to play a role, detailed use of parameters please refer to the Man manual.

One DF

The DF command can get information about how much space the hard disk is taking up, how much space is left, and it can also show the usage of all file systems on the I node and disk blocks.

Common use methods such as: Df-h are displayed in a way that is easy for humans to read.


Two Du

Du's English literal is "disk usage", meaning to show the use of disk space, the size of the statistics directory (or file) of disk space. The function of this command is to step into each subdirectory of the specified directory and show that the directory occupies the file system data block (1024 bytes). If the specified directory is not given, the current directory is counted.

Common use is: List the current directory size: Du-sh If you want to list the size of each subdirectory in the current directory: Du-sh *


Three Fdisk

You can partition the disk, and you can also view the entire disk size, especially if the disk has just been bought and not formatted with the partition, you can use:

fdisk/dev/(your disk name) after entering, use the P command to view disk details.


Four Iostat can provide rich IO status data

$ iostat-d-K 1 10

The parameter-D indicates that the device (disk) usage status is displayed; k Some columns that use block are forced to use kilobytes; 1 10 indicates that the data is refreshed every 1 seconds and is displayed 10 times.

More statistics can be obtained using the-x parameter, and some of the display parameters are explained as follows:

RRQM/S: How much of this device-dependent read request is merged per second (when the system call needs to read the data, the VFS sends the request to each FS, and if FS finds that different read requests read the same block data, FS merges the request into the merge); wrqm/ S: How much of this device-related write request per second has been merge.


rsec/s: number of sectors read per second; wsec/: Number of sectors written per second. R/s:the number of read requests that were issued to the device per second;w/s:the number of write requests that were issue D to the device per second;


Await: The average time (in microseconds) of processing per IO request. This can be understood as the response time of IO, generally the system IO response time should be less than 5ms, if greater than 10ms is relatively large.


%util: All processing io time, divided by total statistic time, in the statistical time. For example, if the statistic interval is 1 seconds, the device has 0.8 seconds to process Io, and 0.2 seconds is idle, then the device's%util = 0.8/1 = 80%, so this parameter implies the device's busy level. Generally, if this parameter is 100% indicates that the device is already running close to full load (of course if it is a multi-disk, even if%util is 100% because of the concurrency of the disk, disk usage may not be the bottleneck).


Five Vmstat real-time production see memory usage

Not explained, directly on the result:

$ vmstat procs-----------memory-------------Swap-------io------System-------CPU-----r  B   swpd   free   buff  cache   si   so    bi    bo   in   CS US sy ID WA St 0  0      0 2037916 105012 725188< C14/>0    0  206  589  5  2  2  0
Want to see clearly some can add-s back with K M

$ vmstat-s mprocs-----------memory-------------Swap-------io------System-------CPU-----r  B   swpd   free   buff  cache   si   so    bi    bo   in   CS US sy ID WA St 0  0      0   1903    104    723    0    0  207  613  5  2  2  0


six dstat powerful network disk CPU monitoring commands

Color display CPU, disk, network, IO, memory and other usage.

Dstat----total-cpu-usage-----dsk/total--net/total----Paging-----system--usr sys IDL Wai HiQ siq| Read  writ| recv  send|  In Out   | int   CSW   5   2   2   0   0| 266k   70k|   0     0 |   0     0 | 825  2532   2   2   0   0|3596k   84k| 352B    0 |   0     0 | 894    12k  3   3  0   0|2632k    0 |   0     0 |   0     0 |1025  7427   1   1   0   0|3020k   52k| 128B  142b|   0     0 | 534  4132   2   1   9 0   0|3236k    0 | 160B   78b|   0     0 | 597  6167 ^C

By default, five zones are divided:

1,--total-cpu-usage----CPU utilization
usr: Percentage of user space programs;
SYS: The percentage of system space programs;
Idel: Idle percentage;
Wai: The percentage that is consumed by waiting for disk I/O;
HiQ: Number of hard interrupts;
Siq: Number of soft interrupts;
2.-dsk/total-Disk Statistics
READ: Total reads
Writ: Write Total
3,-net/total-Network statistics
RECV: Total Network receipts
Send: Total network packets
4,---paging--Memory paging statistics
In:pagein (Swap in)
Out:page out (swap out)
Note: Paging activity of the system. Paging refers to a memory management technology used to find system scenarios, a large paging indicates that the system is using a lot of swap space, usually when the system has started to swap space, it means that your memory is not enough, or the memory is very scattered, ideally page in (Swap in) and page The value of out (swap out) is 0 0.
5.--system--System Information
int: Number of interrupts
CSW: Context Switch
Note: interrupts (int) and context switches (CSW). This statistic only makes sense when there are baseline comparisons. The higher statistics in this column usually indicate that a large number of processes are causing congestion and need to focus on the CPU. Your server will normally run some programs, so this always shows some values.
By default, Dstat refreshes the data every second, refreshes and outputs all the time, and presses CTRL + C to exit "Dstat"

Seven Iotop viewing the IO performance of a process

The above command only looks at the IO performance of the entire hard disk and cannot monitor the IO performance of each process. The iotop is used to monitor the IO performance of each process,

Similar to the top command to view the status of a process, I need super privileges to run

Very intuitive to display the read and write speed of each process, no results, self-authentication.

Eight nload command line real-time monitoring speed

Nload <eth0/wlan0>


Attached: View the top 10 most occupied folders in a directory on your system:

<pre name= "code" class= "python" >sudo  du-sh *./| sort-n-r | Head-n 10




Linux Disk Performance monitoring

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.