嵌入式 iostat命令详解

2024-01-05 11:38
文章标签 命令 详解 嵌入式 iostat

本文主要是介绍嵌入式 iostat命令详解,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

iostat

iostat用于输出CPU和磁盘I/O相关的统计信息. 
命令格式:

<span style="font-size:12px;"><span class="search_hit" style="line-height: normal;"><span style="background-color: rgb(247, 247, 247);">iostat</span></span> [ -c | -d ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ device [ ... ] | ALL ] [ -p [ device | ALL ]  ]<br style="line-height: normal;" />       [ interval [ count ] ]</span>

1)iostat的 简单使用

iostat可以显示CPU和I/O系统的负载情况及分区状态信息. 
直接执行iostat可以显示下面内容:

<span style="font-size:12px;"># </span><span style="font-size:12px;"><span style="background-color: rgb(247, 247, 247);"><span><span><span class="search_hit" style="line-height: normal;">iostat</span><br style="line-height: normal;" />Linux 2.6.9-8.11.EVAL (ts3-150.ts.cn.tlan)      08/08/2007<br style="line-height: normal;" /><br style="line-height: normal;" />avg-cpu:  %user   %nice    %sys %iowait   %idle<br style="line-height: normal;" />             12.01    0.00        2.15    2.30       83.54<br style="line-height: normal;" /><br style="line-height: normal;" />Device:            tps   Blk_read/s   </span><span class="search_hit" style="line-height: normal;">Blk_wrtn</span>/s   Blk_read   </span><span class="search_hit" style="line-height: normal;">Blk_wrtn</span><br style="line-height: normal;" /></span>hda               7.13       200.12        34.73     640119     111076</span>

各个输出项目的含义如下:

<span style="font-size:12px;">avg-cpu段:<br style="line-height: normal;" />%user: 在用户级别运行所使用的CPU的百分比.<br style="line-height: normal;" />%nice: nice操作所使用的CPU的百分比.<br style="line-height: normal;" />%sys: 在系统级别(kernel)运行所使用CPU的百分比.<br style="line-height: normal;" />%iowait: CPU等待硬件I/O时,所占用CPU百分比.<br style="line-height: normal;" />%idle: CPU空闲时间的百分比.<br style="line-height: normal;" />Device段:<br style="line-height: normal;" />tps: 每秒钟发送到的I/O请求数.<br style="line-height: normal;" />Blk_read /s: 每秒读取的block数.<br style="line-height: normal;" /></span><span style="font-size:12px;"><span style="background-color: rgb(247, 247, 247);"><span><span class="search_hit" style="line-height: normal;">Blk_wrtn</span>/s: 每秒写入的block数.<br style="line-height: normal;" />Blk_read:   读入的block总数.<br style="line-height: normal;" /></span><span class="search_hit" style="line-height: normal;">Blk_wrtn</span></span>:  写入的block总数.</span>
2)iostat参 数说明

iostat各个参数说明:

<span style="font-size:12px;">-c 仅显示CPU统计信息.与-d选项互斥.<br style="line-height: normal;" /> -d 仅显示磁盘统计信息.与-c选项互斥.<br style="line-height: normal;" /> -k 以K为单位显示每秒的磁盘请求数,默认单位块.<br style="line-height: normal;" /> -p device | ALL<br style="line-height: normal;" />  与-x选项互斥,用于显示块设备及系统分区的统计信息.也可以在-p后指定一个设备名,如:<br style="line-height: normal;" />  # </span><span style="font-size:12px;"><span style="background-color: rgb(247, 247, 247);"><span><span class="search_hit" style="line-height: normal;">iostat</span> -p hda<br style="line-height: normal;" />  或显示所有设备<br style="line-height: normal;" />  # </span><span class="search_hit" style="line-height: normal;">iostat</span></span> -p ALL<br style="line-height: normal;" /> -t    在输出数据时,打印搜集数据的时间.<br style="line-height: normal;" /> -V    打印版本号和帮助信息.<br style="line-height: normal;" /> -x    输出扩展信息.</span>
3)iostat输 出项目说明
<span style="font-size:12px;">Blk_read<br style="line-height: normal;" />  读入块的当总数.<br style="line-height: normal;" /><br style="line-height: normal;" />              </span><span style="font-size:12px;"><span style="background-color: rgb(247, 247, 247);"><span class="search_hit" style="line-height: normal;">Blk_wrtn</span><br style="line-height: normal;" /></span>  写入块的总数.<br style="line-height: normal;" /><br style="line-height: normal;" />              kB_read/s<br style="line-height: normal;" />  每秒从驱动器读入的数据量,单位为K.<br style="line-height: normal;" /><br style="line-height: normal;" />              kB_wrtn/s<br style="line-height: normal;" />  每秒向驱动器写入的数据量,单位为K.<br style="line-height: normal;" /><br style="line-height: normal;" />              kB_read<br style="line-height: normal;" />  读入的数据总量,单位为K.<br style="line-height: normal;" /><br style="line-height: normal;" />              kB_wrtn<br style="line-height: normal;" />  写入的数据总量,单位为K.<br style="line-height: normal;" /><br style="line-height: normal;" />              rrqm/s<br style="line-height: normal;" />  将读入请求合并后,每秒发送到设备的读入请求数.<br style="line-height: normal;" /><br style="line-height: normal;" />              wrqm/s<br style="line-height: normal;" />  将写入请求合并后,每秒发送到设备的写入请求数.<br style="line-height: normal;" /><br style="line-height: normal;" />              r/s<br style="line-height: normal;" />  每秒发送到设备的读入请求数.<br style="line-height: normal;" /><br style="line-height: normal;" />              w/s<br style="line-height: normal;" />  每秒发送到设备的写入请求数.<br style="line-height: normal;" /><br style="line-height: normal;" />              rsec/s<br style="line-height: normal;" />  每秒从设备读入的扇区数.<br style="line-height: normal;" /><br style="line-height: normal;" />              wsec/s<br style="line-height: normal;" />  每秒向设备写入的扇区数.<br style="line-height: normal;" /><br style="line-height: normal;" />              rkB/s<br style="line-height: normal;" />  每秒从设备读入的数据量,单位为K.<br style="line-height: normal;" /><br style="line-height: normal;" />              wkB/s<br style="line-height: normal;" />  每秒向设备写入的数据量,单位为K.<br style="line-height: normal;" /><br style="line-height: normal;" />              avgrq-sz<br style="line-height: normal;" />  发送到设备的请求的平均大小,单位是扇区.<br style="line-height: normal;" /><br style="line-height: normal;" />              avgqu-sz<br style="line-height: normal;" />  发送到设备的请求的平均队列长度.<br style="line-height: normal;" /><br style="line-height: normal;" />              await<br style="line-height: normal;" />  I/O请求平均执行时间.包括发送请求和执行的时间.单位是毫秒.<br style="line-height: normal;" /><br style="line-height: normal;" />              svctm<br style="line-height: normal;" />  发送到设备的I/O请求的平均执行时间.单位是毫秒.<br style="line-height: normal;" /><br style="line-height: normal;" />              %util<br style="line-height: normal;" />  在I/O请求发送到设备期间,占用CPU时间的百分比.用于显示设备的带宽利用率.<br style="line-height: normal;" />  当这个值接近100%时,表示设备带宽已经占满.</span>
4)iostat示 例
<span style="font-size:12px;">#  </span><span style="font-size:12px;"><span style="background-color: rgb(247, 247, 247);"><span><span><span><span class="search_hit" style="line-height: normal;">iostat</span><br style="line-height: normal;" /> 显示一条统计记录,包括所有的CPU和设备.<br style="line-height: normal;" /><br style="line-height: normal;" />      # </span><span class="search_hit" style="line-height: normal;">iostat</span> -d 2<br style="line-height: normal;" /> 每隔2秒,显示一次设备统计信息.<br style="line-height: normal;" /><br style="line-height: normal;" />      # </span><span class="search_hit" style="line-height: normal;">iostat</span> -d 2 6<br style="line-height: normal;" /> 每隔2秒,显示一次设备统计信息.总共输出6次.<br style="line-height: normal;" /><br style="line-height: normal;" />      # </span><span class="search_hit" style="line-height: normal;">iostat</span> -x hda hdb 2 6<br style="line-height: normal;" /> 每隔2秒显示一次hda,hdb两个设备的扩展统计信息,共输出6次.<br style="line-height: normal;" /><br style="line-height: normal;" />      # <span class="search_hit" style="line-height: normal;">iostat</span></span> -p sda 2 6<br style="line-height: normal;" /> 每隔2秒显示一次sda及上面所有分区的统计信息,共输出6次.</span>

这篇关于嵌入式 iostat命令详解的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/572730

相关文章

MySQL 中的 JSON 查询案例详解

《MySQL中的JSON查询案例详解》:本文主要介绍MySQL的JSON查询的相关知识,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录mysql 的 jsON 路径格式基本结构路径组件详解特殊语法元素实际示例简单路径复杂路径简写操作符注意MySQL 的 J

Python ZIP文件操作技巧详解

《PythonZIP文件操作技巧详解》在数据处理和系统开发中,ZIP文件操作是开发者必须掌握的核心技能,Python标准库提供的zipfile模块以简洁的API和跨平台特性,成为处理ZIP文件的首选... 目录一、ZIP文件操作基础三板斧1.1 创建压缩包1.2 解压操作1.3 文件遍历与信息获取二、进阶技

一文详解Java异常处理你都了解哪些知识

《一文详解Java异常处理你都了解哪些知识》:本文主要介绍Java异常处理的相关资料,包括异常的分类、捕获和处理异常的语法、常见的异常类型以及自定义异常的实现,文中通过代码介绍的非常详细,需要的朋... 目录前言一、什么是异常二、异常的分类2.1 受检异常2.2 非受检异常三、异常处理的语法3.1 try-

Java中的@SneakyThrows注解用法详解

《Java中的@SneakyThrows注解用法详解》:本文主要介绍Java中的@SneakyThrows注解用法的相关资料,Lombok的@SneakyThrows注解简化了Java方法中的异常... 目录前言一、@SneakyThrows 简介1.1 什么是 Lombok?二、@SneakyThrows

Java中字符串转时间与时间转字符串的操作详解

《Java中字符串转时间与时间转字符串的操作详解》Java的java.time包提供了强大的日期和时间处理功能,通过DateTimeFormatter可以轻松地在日期时间对象和字符串之间进行转换,下面... 目录一、字符串转时间(一)使用预定义格式(二)自定义格式二、时间转字符串(一)使用预定义格式(二)自

Redis Pipeline(管道) 详解

《RedisPipeline(管道)详解》Pipeline管道是Redis提供的一种批量执行命令的机制,通过将多个命令一次性发送到服务器并统一接收响应,减少网络往返次数(RTT),显著提升执行效率... 目录Redis Pipeline 详解1. Pipeline 的核心概念2. 工作原理与性能提升3. 核

Python正则表达式语法及re模块中的常用函数详解

《Python正则表达式语法及re模块中的常用函数详解》这篇文章主要给大家介绍了关于Python正则表达式语法及re模块中常用函数的相关资料,正则表达式是一种强大的字符串处理工具,可以用于匹配、切分、... 目录概念、作用和步骤语法re模块中的常用函数总结 概念、作用和步骤概念: 本身也是一个字符串,其中

Nginx location匹配模式与规则详解

《Nginxlocation匹配模式与规则详解》:本文主要介绍Nginxlocation匹配模式与规则,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、环境二、匹配模式1. 精准模式2. 前缀模式(不继续匹配正则)3. 前缀模式(继续匹配正则)4. 正则模式(大

Android实现在线预览office文档的示例详解

《Android实现在线预览office文档的示例详解》在移动端展示在线Office文档(如Word、Excel、PPT)是一项常见需求,这篇文章为大家重点介绍了两种方案的实现方法,希望对大家有一定的... 目录一、项目概述二、相关技术知识三、实现思路3.1 方案一:WebView + Office Onl

Java实现优雅日期处理的方案详解

《Java实现优雅日期处理的方案详解》在我们的日常工作中,需要经常处理各种格式,各种类似的的日期或者时间,下面我们就来看看如何使用java处理这样的日期问题吧,感兴趣的小伙伴可以跟随小编一起学习一下... 目录前言一、日期的坑1.1 日期格式化陷阱1.2 时区转换二、优雅方案的进阶之路2.1 线程安全重构2