nfsiostat 命令

nfsiostat 命令

nfsiostat 命令用作服务器上 NFS 挂载点的 iostat 命令。

它使用文件 /proc/self/mountstats 作为输入,并提供有关系统中挂载的 NFS 共享的输入/输出性能的信息。

下面是 nfsiostat 命令的示例输出。

下表显示了关于输出中每一列的简短描述。

字段 描述
op/s 这是每秒的操作数。
rpc bklog 这是积压队列的长度。
kB/s 这是每秒写入/读取的 kB 数。
kB/op 这是每次操作写入/读取的 kB 数。
retrans 这是重传的次数。
avg RTT (ms) 这是从客户端's 内核发送 RPC 请求到它收到回复的持续时间。
avg exe (ms) 这是从 NFS 客户端向其内核发出 RPC 请求到 RPC 请求完成的持续时间,这包括上面的 RTT 时间。

nfsiostat 命令语法

下面是使用 nfsiostat 命令的语法。

|-------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # nfsiostat --help Usage: nfsiostat [interval] [count] [options] [``mount point] Options: ``--version show program's version number and ``exit ``-h, --help show this help message and ``exit ``Statistics Options: ``File I``/O is displayed unless one of the following is specified: ``-a, --attr displays statistics related to the attribute cache ``-d, --``dir displays statistics related to directory operations ``-p, --page displays statistics related to the page cache ``Display Options: ``Options affecting display ``format``: ``-s, --``sort Sort NFS ``mount points by ops``/second ``-l LIST, --list=LIST ``only print stats ``for first LIST ``mount points |

其中:

每个报告之间的间隔时间(以秒为单位)。

计算间隔 interval 秒生成的报告数量。

如果我们在此处不指定计数,则报告将按指定的时间间隔计数生成。

选项 下面的示例解释了各种选项。

mount_point 我们可以指定要显示统计信息的特定 NFS 挂载点。

在这种情况下,仅生成指定挂载点的报告。

nfsiostat 命令示例

1. 不带任何参数运行 nfsiostat

当我们使用间隔作为参数运行 nfsiostat 时,将显示与前一个间隔的差异,否则结果将来自安装共享的时间。

例如 :

|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1 2 3 4 5 6 7 8 | # nfsiostat 10.130.12.150:``/data01 mounted on ``/data01``: ``op``/s rpc bklog ``0.08 0.00 read``: ops``/s kB``/s kB``/op retrans avg RTT (ms) avg exe (ms) ``0.052 6.436 124.154 0 (0.0%) 9.365 9.617 write: ops``/s kB``/s kB``/op retrans avg RTT (ms) avg exe (ms) ``0.001 0.214 199.536 0 (0.0%) 5.673 72.526 |

2. 以特定时间间隔运行 nfsiostat

我们可以在无限时间内以特定时间间隔运行 nfsiostat 命令。

在这种情况下不要提供 count 参数。

例如,要以 5 秒的间隔连续运行 nfsiostat 命令:

|---|-----------------|
| 1 | # nfsiostat 5 |

如果我们不希望 nfsiostat 连续运行并且只需要有限数量的报告,请使用 count 参数和 interval 参数。

例如,要以 5 秒的间隔生成 10 个报告,请使用以下命令。

|---|--------------------|
| 1 | # nfsiostat 5 10 |

3. 仅针对特定挂载点运行 nfsiostat

如果我们在服务器上有多个挂载 NFS 挂载点,并且我们只关心特定的 NFS 挂载点,则可以使用以下命令仅显示该挂载点的统计信息。

|---|-------------------------------------------|
| 1 | # nfsiostat 5 5 /particular/mount/point |

4. 按每秒操作数排序输出

要按 NFS 挂载点上的每秒操作数对报告输出进行排序,请使用"-s"或者"-sort"参数。

例如,

|---|------------------|
| 1 | # nfsiostat -s |

5. 显示与特定参数相关的统计信息

如果我们只想显示与特定参数有关的 io 统计信息,我们可以在 nfsiostat 命令中使用以下选项。

  • -a - 显示与属性缓存相关的统计信息
  • -d - 显示与目录操作相关的统计信息
  • -p - 显示与页面缓存相关的统计信息
相关推荐
Yana.nice5 小时前
Linux 只保留 30 天内日志(find命令删除日志文件)
linux·运维·chrome
DFT计算杂谈8 小时前
无 Root 权限在 Tesla K80 零门槛部署 DeepSeek 大模型
linux·服务器·网络·数据库·机器学习
Zhang~Ling9 小时前
从 fopen 到 struct file:从零开始拆解 Linux 文件 I/O
linux·运维·服务器
DeeplyMind9 小时前
Linux 深入 per-VMA lock:Linux 缺页路径如何摆脱 mmap_lock
linux·per-vma lock
爱写代码的森10 小时前
蒙三方库 | harmony-utils之FileUtil文件重命名与属性查询详解
linux·运维·服务器·华为·harmonyos·鸿蒙·huawei
XMAIPC_Robot11 小时前
软硬协同实时控制|RK3588业务调度+FPGA硬件时序,ethercat实现半导体设备微秒级响应(125us)
linux·arm开发·人工智能·fpga开发
重生的黑客11 小时前
Linux 进程优先级、切换与调度:从孤儿进程到 O(1) 调度模型
linux·运维·服务器·进程优先级·nice
骑上单车去旅行12 小时前
MD5校验对比脚本
linux·服务器·windows
平生幻13 小时前
Linux 常用命令
linux
ShirleyWang01214 小时前
让headlamp控制台能访问
linux·服务器·python·k8s·k3s