Linux disk performance monitoring, linux disk Performance
In linux, many commands for viewing processes are also very powerful. Commonly Used Commands include: ps top
However, the disk performance monitoring is not so uniform.
The following lists some disk monitoring commands, which only serve as an example. For detailed parameters, see the man manual.
1 df
The df command can be used to obtain the space occupied by the hard disk and the amount of space remaining. It can also display the I node and disk block usage of all file systems.
Common usage methods such as df-h are displayed in a human-readable manner.
Dual du
The original English meaning of du is "disk usage", which means to display the usage of disk space and count the disk space occupied by directories (or files. The function of this command is to step through each sub-directory of the specified directory and display the directory's usage of the file system data block (1024 bytes. If no specified directory is provided, the current directory is counted.
Common usage: list the current directory size: du-sh if you want to list the subdirectories in the current directory: du-sh *
Trifdisk
You can partition the disk or view the size of the entire disk, especially when the disk is just purchased and has no partition formatting, you can use:
After fdisk/dev/(your disk name) is entered, run the p command to view the disk details.
Iostat provides rich IO status data.
$ Iostat-d-k 1 10
The-d parameter indicates that the Usage Status of the device (Disk) is displayed.-k indicates that Kilobytes is used as the unit of block usage. 1 10 indicates that the data is refreshed every one second, 10 times in total.
You can use the-x parameter to obtain more statistics. The parameters displayed in the Section are described as follows:
Rrqm/s: the number of read requests related to this device per second is Merge (when the system calls a request to read data, VFS sends the request to each FS, if FS finds that different read requests read data of the same Block, FS merges the request with Merge); wrqm/s: the number of write requests related to this device per second is Merge.
Rsec/s: Number of read sectors per second; wsec/: Number of write sectors 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 issued to the device per second;
Await: Average time (in microseconds) for processing each IO request ). This can be understood as the IO response time. Generally, the system IO response time should be less than 5 ms. If it is greater than 10 ms, it will be relatively large.
% Util: All IO processing time within the statistical time, divided by the total statistical time. For example, if the statistical interval is 1 second, the device processes IO for 0.8 seconds, and the device is idle for 0.2 seconds, % util = 0.8/1 = 80%, therefore, this parameter implies the degree to which the device is busy. Generally, if this parameter is set to 100%, it indicates that the device is nearing full load (of course, if it is a multi-disk, even if % util is 100%, because of the disk concurrency, so the disk usage may not be a bottleneck ).
5. vmstat real-time production depends on memory usage
If you do not want to explain it, go directly to 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 0 0 63 18 206 589 5 2 92 2 0
For more information, see-S and 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 57 17 207 613 5 2 92 2 0
Six dstat powerful network disk cpu monitoring command
Color Display of cpu, disk, network, I/O, memory usage, etc.
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 92 2 0 0| 266k 70k| 0 0 | 0 0 | 825 2532 2 2 82 14 0 0|3596k 84k| 352B 0 | 0 0 | 894 12k 3 3 83 11 0 0|2632k 0 | 0 0 | 0 0 |1025 7427 1 1 87 11 0 0|3020k 52k| 128B 142B| 0 0 | 534 4132 2 1 88 9 0 0|3236k 0 | 160B 78B| 0 0 | 597 6167 ^C
By default, there are five regions:
1. -- total-cpu-usage ---- CPU usage
Usr: Percentage of programs in the user space;
Sys: Percentage of system space programs;
Idel: Percentage of idle resources;
Wai: Percentage consumed by waiting for disk I/O;
Hiq: the number of hard interruptions;
Siq: Number of soft interruptions;
2.-dsk/total-disk statistics
Read: Total number of reads
Writ: Total number of writes
3.-net/total-network statistics
Recv: Total number of network packages received
Send: Total number of network packets
4. --- paging -- Memory paging statistics
In: pagein (in)
Out: page out (swap out)
Note: System paging activity. Paging refers to a memory management technology used to search for system scenarios. A large paging indicates that the system is using a large amount of swap space. Generally, when the system has started to use swap space, it means that your memory is not enough, or the memory is very scattered. Ideally, the value of page in and page out is 0 0.
5. -- system Information
Int: number of interruptions
Csw: context switch
Note: interrupt (int) and context switch (csw ). This statistic is meaningful only when compared baselines exist. The high statistical value in this column usually indicates that a large number of processes cause congestion and the CPU needs to be concerned. Generally, your server runs some programs, so this always displays some numerical values.
By default, dstat refresh the data every second, refresh the data and output the data all the time, and press Ctrl + C to exit "dstat"
Seven iotop view process I/O performance
The preceding command can only view the I/O performance of the entire hard disk, but cannot monitor the I/O performance of each process. Iotop is used to monitor the io performance of each process,
Similar to the top command for viewing the Process status, I need super permissions to run
The read/write speed of each process is displayed intuitively, and the result is not displayed. Verify the result by yourself.
Eight nload command lines monitor the network speed in real time
Nload <eth0/wlan0>
Appendix: view the top 10 most occupied folders in a directory in the system:
<pre name="code" class="python">sudo du -sh * ./ | sort -n -r | head -n 10