Linux IO Real-time monitoring iostat command detailed

Source: Internet
Author: User
Tags disk usage
<span id="Label3"></p><strong><strong><span style="line-height:1.5;font-size:14pt;">Introduction</span></strong></strong><p style="font-size:13px;line-height:19.5px;margin:10px auto;font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;white-space:normal;background-color:rgb(255,255,255);"><p style="font-size:13px;line-height:19.5px;margin:10px auto;font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;white-space:normal;background-color:rgb(255,255,255);"><span style="line-height:1.5;">The Iostat is primarily used to monitor the IO load on the system device, Iostat the statistics from the start of the system startup when the first run, and then running Iostat displays statistics from the last time the command was Run. Users can obtain the required statistics by specifying the number and time of the Statistics.</span></p></p><strong><strong><span style="line-height:1.5;font-size:14pt;">Grammar</span></strong></strong><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;"><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;">Iostat [-c] [-d] [-h] [-n] [-k |-m] [-t] [-v] [-x] [-z] [device [...] | all] [-p [device [,...] | all] [interval [count]]</pre></pre><strong><strong><span style="line-height:1.5;font-size:14pt;">Getting Started with</span></strong></strong><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;"><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;">Iostat-d-k 2</pre></pre><p style="font-size:13px;line-height:19.5px;margin:10px auto;font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;white-space:normal;background-color:rgb(255,255,255);"><p style="font-size:13px;line-height:19.5px;margin:10px auto;font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;white-space:normal;background-color:rgb(255,255,255);"><span style="line-height:1.5;">The parameter-d indicates that the device (disk) usage status is displayed; K some columns that use block are forced to use kilobytes, and 2 indicates that the data appears refreshed every 2 seconds.</span></p></p><p style="font-size:13px;line-height:19.5px;margin:10px auto;font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;white-space:normal;background-color:rgb(255,255,255);"><p style="font-size:13px;line-height:19.5px;margin:10px auto;font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;white-space:normal;background-color:rgb(255,255,255);"><span style="line-height:1.5;">The output is as follows</span></p></p><p><p>Iostat-d-k 1 10</p></p><p><p>Device:tps kb_read/s kb_wrtn/s Kb_read Kb_wrtn</p></p><p><p>SDA 39.29 21.14 1.44 441339807 29990031</p></p><p><p>SDA1 0.00 0.00 0.00 1623 523</p></p><p><p>Sda2 1.32 1.43 4.54 29834273 94827104</p></p><p><p>Sda3 6.30 0.85 24.95 17816289 520725244</p></p><p><p>Sda5 0.85 0.46 3.40 9543503 70970116</p></p><p><p>SDA6 0.00 0.00 0.00 550 236</p></p><p><p>SDA7 0.00 0.00 0.00 406 0</p></p><p><p>SDA8 0.00 0.00 0.00 406 0</p></p><p><p>SDA9 0.00 0.00 0.00 406 0</p></p><p><p>SDA10 60.68 18.35 71.43 383002263 1490928140</p></p><p><p><br></p></p><p><p>Device:tps kb_read/s kb_wrtn/s Kb_read Kb_wrtn</p></p><p><p>SDA 327.55 5159.18 102.04 5056 100</p></p><p><p>SDA1 0.00 0.00 0.00 0 0</p></p><p><p><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);">The meaning of the output information</span></p></p><p><p></p></p><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;"><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;">Tps: the number of transmissions per second of the device (indicate, transfers per second, were issued to the.). It means. Multiple logical requests may be merged into. /s: The amount of data read from the device (drive expressed) per second; kb_wrtn/</pre></pre><p><p><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);">In the example above, we can see statistics on the disk SDA and its partitions, when the total disk TPS for statistics is 39.29, and the following is the TPS for each Partition. (because It is an instantaneous value, the total TPS is not strictly equal to the sum of each partition Tps)</span><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);"></span><br></p></p><p><p><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);"><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);">Specifies that the monitored device name is sda, and that the output of the command is exactly the same as the command Above.</span></span></p></p><p><p><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);"></span></p></p><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;"><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;">Iostat-d SDA 2</pre></pre><p><p><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);">By default, all hard disk devices are monitored and are now designated to monitor SDA Only.</span><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);"></span><br></p></p><p><p></p></p><strong>- <strong><span style="line-height:1.5;font-size:14pt;">x Parameter</span></strong></strong><p><p><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);">Iostat also has a more common option</span> - <strong style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;white-space:normal;background-color:rgb(255,255,255);">x</strong> <span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);">, this option will be used to display and io-related extended Data. </span><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);"></span><br></p></p><p><p></p></p><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;">iostat -d -x -k 1 10device:    rrqm/s wrqm/s    r/s   w/s  rsec/s  wsec/s    rkB/s     wkb/s avgrq-sz avgqu-sz   await  svctm  %utilsda           1.56  28.31  7.80 31.49    42.51    2.92    21.26      1.46     1.16     0.03    0.79    2.62  10.28Device:    rrqm/s wrqm/s   r/s    w/s  rsec/s  wsec/s    rkb/s    wkb/s  avgrq-sz avgqu-sz   await  svctm  %utilsda           2.00  20.00 381.00  7.00 12320.00  216.00  6160.00    108.00    32.31     1.75     4.50   2.17  84.20</pre><p><p>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.</p></p><p><p><br></p></p><p><p>Rsec/s: number of sectors read per second;</p></p><p><p>Wsec/: number of sectors written per Second.</p></p><p><p>Rkb/s:the number of read requests that were issued to the device per second;</p></p><p><p>Wkb/s:the number of write requests that were issued to the device per second;</p></p><p><p>Avgrq-sz the size of the average request sector</p></p><p><p>The Avgqu-sz is the length of the average request Queue. There is no doubt that the shorter the queue, the Better.</p></p><p><p>Await: The average time (in milliseconds) 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.</p></p><p><p>This time includes the queue time and service time, that is, in general, await is greater than svctm, their difference is smaller, then the shorter the queue time, conversely, the greater the difference, the longer the queue time, indicating that the system has a problem.</p></p><p><p>SVCTM represents the average service time (in Milliseconds) for each device I/O Operation. If the value of SVCTM is close to await, indicating that there is little I/O waiting, disk performance is good, and if the value of await is much higher than the value of svctm, the I/O queue waits too long for the applications running on the system to become slower.</p></p><p><p>%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</p></p><p><p>。 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).</p></p><p><p><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);"></span><br></p></p><strong>- <strong><span style="line-height:1.5;font-size:14pt;">C parameter</span></strong></strong><p style="font-size:13px;line-height:19.5px;margin:10px auto;font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;white-space:normal;background-color:rgb(255,255,255);"><p style="font-size:13px;line-height:19.5px;margin:10px auto;font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;white-space:normal;background-color:rgb(255,255,255);">Iostat can also be used to get CPU partial state values:</p></p><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;"><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;">Iostat-c 1 10avg-cpu:%user%nice%sys%iowait%idle1.98 0.00 0.35 11.45 86.22avg-cpu:%user%nice%sys%iowait%idle1.62 0.00 0.25 34.46 63.67</pre></pre><strong><strong><span style="line-height:1.5;font-size:14pt;">Common usage</span></strong></strong><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;"><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;">Iostat-d-k 1 #查看TPS和吞吐量信息 (disk Read and write speed in Kb) iostat-d-m 2 #查看TPS和吞吐量信息 (disk Read and write speed in Mb) iostat-d-x-k 1 10 #查看设备使用率 (%util), Response Time (await) iostat-c 1 #查看cpu状态</pre></pre><strong><strong><span style="line-height:1.5;font-size:14pt;">Example Analysis</span></strong></strong><p><p>Ostat-d-k 1 |grep sda10</p></p><p><p>Device:tps kb_read/s kb_wrtn/s Kb_read Kb_wrtn</p></p><p><p>SDA10 60.72 18.95 71.53 395637647 1493241908</p></p><p><p>SDA10 299.02 4266.67 129.41 4352 132</p></p><p><p>SDA10 483.84 4589.90 4117.17 4544 4076</p></p><p><p>SDA10 218.00 3360.00 100.00 3360 100</p></p><p><p>SDA10 546.00 8784.00 124.00 8784 124</p></p><p><p>SDA10 827.00 13232.00 136.00 13232 136</p></p><p><p><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);">As seen above, the average number of disk transfers per second is about 400, and the disk reads about 5MB per second and writes about 1MB.</span></p></p><p><p></p></p><pre style="margin-top:0px;margin-bottom:0px;white-space:pre-wrap;font-size:12px;line-height:18px;font-family:‘Courier New‘;">iostat -d -x -k 1device:    rrqm/s wrqm/s   r/s    w/s  rsec/s  wsec/s    rkB/s     wkb/s avgrq-sz avgqu-sz   await  svctm  %utilsda           1.56  28.31  7.84 31.50    43.65    3.16    21.82     1.58      1.19     0.03    0.80    2.61  10.29sda          1.98  24.75  419.80  6.93 13465.35  253.47  6732.67   126.73     32.15     2.00    4.70   2.00   85.25sda          3.06  41.84 444.90 54.08 14204.08  2048.98  7102.04  1024.49    32.57      2.10    4.21   1.85  92.24</pre><p><p><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);">You can see the average response time of the disk <5ms, and the disk usage is >80. The disk responds properly, but it is already busy.</span><span style="font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;font-size:13px;line-height:19.5px;background-color:rgb(255,255,255);"></span><br></p></p><p><p>This article from "flat light is true" blog, please be sure to keep this source http://ucode.blog.51cto.com/10837891/1826514</p></p><p><p>Linux IO Real-time monitoring iostat command detailed</p></p></span>

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.