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

相关文章

Redis中6种缓存更新策略详解

《Redis中6种缓存更新策略详解》Redis作为一款高性能的内存数据库,已经成为缓存层的首选解决方案,然而,使用缓存时最大的挑战在于保证缓存数据与底层数据源的一致性,本文将介绍Redis中6种缓存更... 目录引言策略一:Cache-Aside(旁路缓存)策略工作原理代码示例优缺点分析适用场景策略二:Re

Java注解之超越Javadoc的元数据利器详解

《Java注解之超越Javadoc的元数据利器详解》本文将深入探讨Java注解的定义、类型、内置注解、自定义注解、保留策略、实际应用场景及最佳实践,无论是初学者还是资深开发者,都能通过本文了解如何利用... 目录什么是注解?注解的类型内置注编程解自定义注解注解的保留策略实际用例最佳实践总结在 Java 编程

MySQL数据库约束深入详解

《MySQL数据库约束深入详解》:本文主要介绍MySQL数据库约束,在MySQL数据库中,约束是用来限制进入表中的数据类型的一种技术,通过使用约束,可以确保数据的准确性、完整性和可靠性,需要的朋友... 目录一、数据库约束的概念二、约束类型三、NOT NULL 非空约束四、DEFAULT 默认值约束五、UN

Python使用Matplotlib绘制3D曲面图详解

《Python使用Matplotlib绘制3D曲面图详解》:本文主要介绍Python使用Matplotlib绘制3D曲面图,在Python中,使用Matplotlib库绘制3D曲面图可以通过mpl... 目录准备工作绘制简单的 3D 曲面图绘制 3D 曲面图添加线框和透明度控制图形视角Matplotlib

MySQL中的分组和多表连接详解

《MySQL中的分组和多表连接详解》:本文主要介绍MySQL中的分组和多表连接的相关操作,本文通过实例代码给大家介绍的非常详细,感兴趣的朋友一起看看吧... 目录mysql中的分组和多表连接一、MySQL的分组(group javascriptby )二、多表连接(表连接会产生大量的数据垃圾)MySQL中的

Java 实用工具类Spring 的 AnnotationUtils详解

《Java实用工具类Spring的AnnotationUtils详解》Spring框架提供了一个强大的注解工具类org.springframework.core.annotation.Annot... 目录前言一、AnnotationUtils 的常用方法二、常见应用场景三、与 JDK 原生注解 API 的

redis中使用lua脚本的原理与基本使用详解

《redis中使用lua脚本的原理与基本使用详解》在Redis中使用Lua脚本可以实现原子性操作、减少网络开销以及提高执行效率,下面小编就来和大家详细介绍一下在redis中使用lua脚本的原理... 目录Redis 执行 Lua 脚本的原理基本使用方法使用EVAL命令执行 Lua 脚本使用EVALSHA命令

SpringBoot3.4配置校验新特性的用法详解

《SpringBoot3.4配置校验新特性的用法详解》SpringBoot3.4对配置校验支持进行了全面升级,这篇文章为大家详细介绍了一下它们的具体使用,文中的示例代码讲解详细,感兴趣的小伙伴可以参考... 目录基本用法示例定义配置类配置 application.yml注入使用嵌套对象与集合元素深度校验开发

Python中的Walrus运算符分析示例详解

《Python中的Walrus运算符分析示例详解》Python中的Walrus运算符(:=)是Python3.8引入的一个新特性,允许在表达式中同时赋值和返回值,它的核心作用是减少重复计算,提升代码简... 目录1. 在循环中避免重复计算2. 在条件判断中同时赋值变量3. 在列表推导式或字典推导式中简化逻辑

Java Stream流使用案例深入详解

《JavaStream流使用案例深入详解》:本文主要介绍JavaStream流使用案例详解,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录前言1. Lambda1.1 语法1.2 没参数只有一条语句或者多条语句1.3 一个参数只有一条语句或者多