uTools-Manuals/docs/linux/iostat.html
2019-04-21 11:50:48 +08:00

162 lines
3.1 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="iostat">iostat</h1>
<p>监视系统输入输出设备和CPU的使用情况</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>iostat命令</strong> 被用于监视系统输入输出设备和CPU的使用情况。它的特点是汇报磁盘活动统计情况同时也会汇报出CPU使用情况。同vmstat一样iostat也有一个弱点就是它不能对某个进程进行深入分析仅对系统的整体情况进行分析。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">iostat(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-c仅显示CPU使用情况
-d仅显示设备利用率
-k显示状态以千字节每秒为单位而不使用块每秒
-m显示状态以兆字节每秒为单位
-p仅显示块设备和所有被使用的其他分区的状态
-t显示每个报告产生时的时间
-V显示版号并退出
-x显示扩展状态。</code></pre>
<h3 id="参数">参数</h3>
<ul>
<li>间隔时间:每次报告的间隔时间(秒);</li>
<li>次数:显示报告的次数。</li>
</ul>
<h3 id="实例">实例</h3>
<p><code>iostat -x /dev/sda1</code>来观看磁盘I/O的详细情况</p>
<pre><code class="language-bash">iostat -x /dev/sda1
Linux 2.6.18-164.el5xen (localhost.localdomain)
2010年03月26日
avg-cpu: %user %nice %system %iowait
%steal %idle
0.11 0.02 0.18 0.35
0.03 99.31
Device: tps Blk_read/s Blk_wrtn/s
Blk_read Blk_wrtn
sda1 0.02 0.08
0.00 2014 4 </code></pre>
<p>详细说明第二行是系统信息和监测时间第三行和第四行显示CPU使用情况具体内容和mpstat命令相同。这里主要关注后面I/O输出的信息如下所示</p>
<table>
<tbody>
<tr>
<th>
标示
</th>
<th>
说明
</th>
</tr>
<tr>
<td>
Device
</td>
<td>
监测设备名称
</td>
</tr>
<tr>
<td>
rrqm/s
</td>
<td>
每秒需要读取需求的数量
</td>
</tr>
<tr>
<td>
wrqm/s
</td>
<td>
每秒需要写入需求的数量
</td>
</tr>
<tr>
<td>
r/s 
</td>
<td>
每秒实际读取需求的数量
</td>
</tr>
<tr>
<td>
w/s
</td>
<td>
每秒实际写入需求的数量
</td>
</tr>
<tr>
<td>
rsec/s
</td>
<td>
每秒读取区段的数量
</td>
</tr>
<tr>
<td>
wsec/s
</td>
<td>
每秒写入区段的数量
</td>
</tr>
<tr>
<td>
rkB/s
</td>
<td>
每秒实际读取的大小单位为KB
</td>
</tr>
<tr>
<td>
wkB/s
</td>
<td>
每秒实际写入的大小单位为KB
</td>
</tr>
<tr>
<td>
avgrq-sz
</td>
<td>
需求的平均大小区段
</td>
</tr>
<tr>
<td>
avgqu-sz
</td>
<td>
需求的平均队列长度
</td>
</tr>
<tr>
<td>
await
</td>
<td>
等待I/O平均的时间milliseconds
</td>
</tr>
<tr>
<td>
svctm
</td>
<td>
I/O需求完成的平均时间
</td>
</tr>
<tr>
<td>
%util
</td>
<td>
被I/O需求消耗的CPU百分比
</td>
</tr>
</tbody>
</table>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->