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

相关文章

Spring Security基于数据库验证流程详解

Spring Security 校验流程图 相关解释说明(认真看哦) AbstractAuthenticationProcessingFilter 抽象类 /*** 调用 #requiresAuthentication(HttpServletRequest, HttpServletResponse) 决定是否需要进行验证操作。* 如果需要验证,则会调用 #attemptAuthentica

嵌入式QT开发:构建高效智能的嵌入式系统

摘要: 本文深入探讨了嵌入式 QT 相关的各个方面。从 QT 框架的基础架构和核心概念出发,详细阐述了其在嵌入式环境中的优势与特点。文中分析了嵌入式 QT 的开发环境搭建过程,包括交叉编译工具链的配置等关键步骤。进一步探讨了嵌入式 QT 的界面设计与开发,涵盖了从基本控件的使用到复杂界面布局的构建。同时也深入研究了信号与槽机制在嵌入式系统中的应用,以及嵌入式 QT 与硬件设备的交互,包括输入输出设

OpenHarmony鸿蒙开发( Beta5.0)无感配网详解

1、简介 无感配网是指在设备联网过程中无需输入热点相关账号信息,即可快速实现设备配网,是一种兼顾高效性、可靠性和安全性的配网方式。 2、配网原理 2.1 通信原理 手机和智能设备之间的信息传递,利用特有的NAN协议实现。利用手机和智能设备之间的WiFi 感知订阅、发布能力,实现了数字管家应用和设备之间的发现。在完成设备间的认证和响应后,即可发送相关配网数据。同时还支持与常规Sof

零基础学习Redis(10) -- zset类型命令使用

zset是有序集合,内部除了存储元素外,还会存储一个score,存储在zset中的元素会按照score的大小升序排列,不同元素的score可以重复,score相同的元素会按照元素的字典序排列。 1. zset常用命令 1.1 zadd  zadd key [NX | XX] [GT | LT]   [CH] [INCR] score member [score member ...]

30常用 Maven 命令

Maven 是一个强大的项目管理和构建工具,它广泛用于 Java 项目的依赖管理、构建流程和插件集成。Maven 的命令行工具提供了大量的命令来帮助开发人员管理项目的生命周期、依赖和插件。以下是 常用 Maven 命令的使用场景及其详细解释。 1. mvn clean 使用场景:清理项目的生成目录,通常用于删除项目中自动生成的文件(如 target/ 目录)。共性规律:清理操作

6.1.数据结构-c/c++堆详解下篇(堆排序,TopK问题)

上篇:6.1.数据结构-c/c++模拟实现堆上篇(向下,上调整算法,建堆,增删数据)-CSDN博客 本章重点 1.使用堆来完成堆排序 2.使用堆解决TopK问题 目录 一.堆排序 1.1 思路 1.2 代码 1.3 简单测试 二.TopK问题 2.1 思路(求最小): 2.2 C语言代码(手写堆) 2.3 C++代码(使用优先级队列 priority_queue)

K8S(Kubernetes)开源的容器编排平台安装步骤详解

K8S(Kubernetes)是一个开源的容器编排平台,用于自动化部署、扩展和管理容器化应用程序。以下是K8S容器编排平台的安装步骤、使用方式及特点的概述: 安装步骤: 安装Docker:K8S需要基于Docker来运行容器化应用程序。首先要在所有节点上安装Docker引擎。 安装Kubernetes Master:在集群中选择一台主机作为Master节点,安装K8S的控制平面组件,如AP

荣耀嵌入式面试题及参考答案

在项目中是否有使用过实时操作系统? 在我参与的项目中,有使用过实时操作系统。实时操作系统(RTOS)在对时间要求严格的应用场景中具有重要作用。我曾参与的一个工业自动化控制项目就采用了实时操作系统。在这个项目中,需要对多个传感器的数据进行实时采集和处理,并根据采集到的数据及时控制执行机构的动作。实时操作系统能够提供确定性的响应时间,确保关键任务在规定的时间内完成。 使用实时操作系统的

嵌入式Openharmony系统构建与启动详解

大家好,今天主要给大家分享一下,如何构建Openharmony子系统以及系统的启动过程分解。 第一:OpenHarmony系统构建      首先熟悉一下,构建系统是一种自动化处理工具的集合,通过将源代码文件进行一系列处理,最终生成和用户可以使用的目标文件。这里的目标文件包括静态链接库文件、动态链接库文件、可执行文件、脚本文件、配置文件等。      我们在编写hellowor

LabVIEW FIFO详解

在LabVIEW的FPGA开发中,FIFO(先入先出队列)是常用的数据传输机制。通过配置FIFO的属性,工程师可以在FPGA和主机之间,或不同FPGA VIs之间进行高效的数据传输。根据具体需求,FIFO有多种类型与实现方式,包括目标范围内FIFO(Target-Scoped)、DMA FIFO以及点对点流(Peer-to-Peer)。 FIFO类型 **目标范围FIFO(Target-Sc