嵌入式 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

相关文章

C++使用栈实现括号匹配的代码详解

《C++使用栈实现括号匹配的代码详解》在编程中,括号匹配是一个常见问题,尤其是在处理数学表达式、编译器解析等任务时,栈是一种非常适合处理此类问题的数据结构,能够精确地管理括号的匹配问题,本文将通过C+... 目录引言问题描述代码讲解代码解析栈的状态表示测试总结引言在编程中,括号匹配是一个常见问题,尤其是在

Debezium 与 Apache Kafka 的集成方式步骤详解

《Debezium与ApacheKafka的集成方式步骤详解》本文详细介绍了如何将Debezium与ApacheKafka集成,包括集成概述、步骤、注意事项等,通过KafkaConnect,D... 目录一、集成概述二、集成步骤1. 准备 Kafka 环境2. 配置 Kafka Connect3. 安装 D

Java中ArrayList和LinkedList有什么区别举例详解

《Java中ArrayList和LinkedList有什么区别举例详解》:本文主要介绍Java中ArrayList和LinkedList区别的相关资料,包括数据结构特性、核心操作性能、内存与GC影... 目录一、底层数据结构二、核心操作性能对比三、内存与 GC 影响四、扩容机制五、线程安全与并发方案六、工程

Spring Cloud LoadBalancer 负载均衡详解

《SpringCloudLoadBalancer负载均衡详解》本文介绍了如何在SpringCloud中使用SpringCloudLoadBalancer实现客户端负载均衡,并详细讲解了轮询策略和... 目录1. 在 idea 上运行多个服务2. 问题引入3. 负载均衡4. Spring Cloud Load

Springboot中分析SQL性能的两种方式详解

《Springboot中分析SQL性能的两种方式详解》文章介绍了SQL性能分析的两种方式:MyBatis-Plus性能分析插件和p6spy框架,MyBatis-Plus插件配置简单,适用于开发和测试环... 目录SQL性能分析的两种方式:功能介绍实现方式:实现步骤:SQL性能分析的两种方式:功能介绍记录

在 Spring Boot 中使用 @Autowired和 @Bean注解的示例详解

《在SpringBoot中使用@Autowired和@Bean注解的示例详解》本文通过一个示例演示了如何在SpringBoot中使用@Autowired和@Bean注解进行依赖注入和Bean... 目录在 Spring Boot 中使用 @Autowired 和 @Bean 注解示例背景1. 定义 Stud

如何通过海康威视设备网络SDK进行Java二次开发摄像头车牌识别详解

《如何通过海康威视设备网络SDK进行Java二次开发摄像头车牌识别详解》:本文主要介绍如何通过海康威视设备网络SDK进行Java二次开发摄像头车牌识别的相关资料,描述了如何使用海康威视设备网络SD... 目录前言开发流程问题和解决方案dll库加载不到的问题老旧版本sdk不兼容的问题关键实现流程总结前言作为

SQL 中多表查询的常见连接方式详解

《SQL中多表查询的常见连接方式详解》本文介绍SQL中多表查询的常见连接方式,包括内连接(INNERJOIN)、左连接(LEFTJOIN)、右连接(RIGHTJOIN)、全外连接(FULLOUTER... 目录一、连接类型图表(ASCII 形式)二、前置代码(创建示例表)三、连接方式代码示例1. 内连接(I

Go路由注册方法详解

《Go路由注册方法详解》Go语言中,http.NewServeMux()和http.HandleFunc()是两种不同的路由注册方式,前者创建独立的ServeMux实例,适合模块化和分层路由,灵活性高... 目录Go路由注册方法1. 路由注册的方式2. 路由器的独立性3. 灵活性4. 启动服务器的方式5.

Java中八大包装类举例详解(通俗易懂)

《Java中八大包装类举例详解(通俗易懂)》:本文主要介绍Java中的包装类,包括它们的作用、特点、用途以及如何进行装箱和拆箱,包装类还提供了许多实用方法,如转换、获取基本类型值、比较和类型检测,... 目录一、包装类(Wrapper Class)1、简要介绍2、包装类特点3、包装类用途二、装箱和拆箱1、装