Linux IO Diagnostic Command set

Source: Internet
Author: User

io.sh# #iostat是查看磁盘活动统计情况 # #显示所有设备负载情况 r/s: Number of Read I/O devices completed per second. That is, rio/s;w/s: The number of write I/O devices completed per second. That is, wio/s and other Iostat # #每隔2秒刷新磁盘IO信息, and 3 times per display Iostat 2 3# shows the IO information of a disk iostat-d sda1# #显示tty和cpu信息iostat-t# #以M为单位显示磁盘IO信息iostat -m# #查看TPS和吞吐量信息 kb_read/s: The amount of data read from the device (drive expressed) per second, KB_WRTN/S: The amount of data written to the device (drive expressed) per second, Kb_read: The total amount of data read; kb_ WRTN: Total amount of data written; iostat-d-K 1 # View Device usage (%util), Response time (await) iostat-d-x-k 1 # View CPU status Iostat-c 1 3# statistics process (PID) stat, Process stat from Including the IO status of the process pidstat# only displays iopidstat-d 1 #-d io information,-r page faults and memory information-U CPU Usage-T with threads for statistical units 1 1 seconds statistics pidstat-u-r-d T-s file level IO analysis, view current file Which processes are open lsof ls/proc/pid/fd# use the SAR to report disk I/O information dev is monitoring the block device TPS per second total I/O transfer of physical devices RD_SEC/S number of sectors read from device per second wr_sec/s per second written to device Number of sectors Avgrq-sz average number of sectors of the I/O request #avgqu-sz Average queue Length of an I/O request await the average wait time for an I/O request, in milliseconds SVCTM the average service time of the I/O request, in milliseconds%util I/O request takes the time ratio, i.e. device utilization SAR-PD 3 #iotop Top IO version iotop# view page cache information where cached refers to the memory size (Diskcache-swapcache) used for Pagecache. With the write cache page, the value of Dirty increases as soon as the cache page is written to the hard disk, the value of writeback increases until the end of the write. Cat/proc/meminfo #查看有多少个pdflush进程 LInux the behavior of using the Pdflush process to write data from the cache page to the hard disk #pdflush is controlled by the parameters in the/PROC/SYS/VM/proc/sys/vm/dirty_writeback_centisecs (default 500): 1/ 100 seconds, how long it takes to wake up Pdflush writes cached page data to the hard disk. The default of 5 seconds wakes up 2 (more) threads. If the wrteback time is longer than dirty_writeback_centisecs, there may be a problem cat/proc/sys/vm/nr_pdflush_threads# view the I/O Scheduler # Scheduling algorithm #noop Anticipatory deadline [CFQ] #deadline: The deadline algorithm guarantees a minimum delay time for a given IO request. #anticipatory: After an IO occurs, if another process requests Io, a default 6ms guessing time is generated, guessing what the next process request Io is doing. This can cause a large delay for random reads. Bad for database applications, and for Web servers. #cfq: Maintaining an IO queue for each process, the IO requests from each process are handled by CFQ in a round-robin manner and are fair to every IO request. Suitable for discrete-time reading applications. #noop: All IO requests are processed in FIFO queue format. There is no performance issue with default IO. cat/sys/block/[disk]/queue/scheduler# Change IO Scheduler $ echo deadline >/sys/block/sdx/queue/scheduler# Increase Scheduler request queue $ echo 4096 >/sys/block/sdx/queue/nr_requests


From your own GitHub https://github.com/zhwj184/shell-work/blob/master/IO.sh


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.