嵌入式 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中DISTINCT去重的核心注意事项

《详解MySQL中DISTINCT去重的核心注意事项》为了实现查询不重复的数据,MySQL提供了DISTINCT关键字,它的主要作用就是对数据表中一个或多个字段重复的数据进行过滤,只返回其中的一条数据... 目录DISTINCT 六大注意事项1. 作用范围:所有 SELECT 字段2. NULL 值的特殊处

SQL BETWEEN 语句的基本用法详解

《SQLBETWEEN语句的基本用法详解》SQLBETWEEN语句是一个用于在SQL查询中指定查询条件的重要工具,它允许用户指定一个范围,用于筛选符合特定条件的记录,本文将详细介绍BETWEEN语... 目录概述BETWEEN 语句的基本用法BETWEEN 语句的示例示例 1:查询年龄在 20 到 30 岁

CSS place-items: center解析与用法详解

《CSSplace-items:center解析与用法详解》place-items:center;是一个强大的CSS简写属性,用于同时控制网格(Grid)和弹性盒(Flexbox)... place-items: center; 是一个强大的 css 简写属性,用于同时控制 网格(Grid) 和 弹性盒(F

spring中的ImportSelector接口示例详解

《spring中的ImportSelector接口示例详解》Spring的ImportSelector接口用于动态选择配置类,实现条件化和模块化配置,关键方法selectImports根据注解信息返回... 目录一、核心作用二、关键方法三、扩展功能四、使用示例五、工作原理六、应用场景七、自定义实现Impor

nginx启动命令和默认配置文件的使用

《nginx启动命令和默认配置文件的使用》:本文主要介绍nginx启动命令和默认配置文件的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录常见命令nginx.conf配置文件location匹配规则图片服务器总结常见命令# 默认配置文件启动./nginx

一文深入详解Python的secrets模块

《一文深入详解Python的secrets模块》在构建涉及用户身份认证、权限管理、加密通信等系统时,开发者最不能忽视的一个问题就是“安全性”,Python在3.6版本中引入了专门面向安全用途的secr... 目录引言一、背景与动机:为什么需要 secrets 模块?二、secrets 模块的核心功能1. 基

一文详解MySQL如何设置自动备份任务

《一文详解MySQL如何设置自动备份任务》设置自动备份任务可以确保你的数据库定期备份,防止数据丢失,下面我们就来详细介绍一下如何使用Bash脚本和Cron任务在Linux系统上设置MySQL数据库的自... 目录1. 编写备份脚本1.1 创建并编辑备份脚本1.2 给予脚本执行权限2. 设置 Cron 任务2

一文详解如何在idea中快速搭建一个Spring Boot项目

《一文详解如何在idea中快速搭建一个SpringBoot项目》IntelliJIDEA作为Java开发者的‌首选IDE‌,深度集成SpringBoot支持,可一键生成项目骨架、智能配置依赖,这篇文... 目录前言1、创建项目名称2、勾选需要的依赖3、在setting中检查maven4、编写数据源5、开启热

Python常用命令提示符使用方法详解

《Python常用命令提示符使用方法详解》在学习python的过程中,我们需要用到命令提示符(CMD)进行环境的配置,:本文主要介绍Python常用命令提示符使用方法的相关资料,文中通过代码介绍的... 目录一、python环境基础命令【Windows】1、检查Python是否安装2、 查看Python的安

HTML5 搜索框Search Box详解

《HTML5搜索框SearchBox详解》HTML5的搜索框是一个强大的工具,能够有效提升用户体验,通过结合自动补全功能和适当的样式,可以创建出既美观又实用的搜索界面,这篇文章给大家介绍HTML5... html5 搜索框(Search Box)详解搜索框是一个用于输入查询内容的控件,通常用于网站或应用程