如何查看NFS的共享性能?

除了 NFS 挂载点之外,nfsiostat 命令的工作方式与 iostat 命令类似。
nfsiostat 从 /proc/self/mountstats 获取输入,并提供有关系统中挂载的 NFS 共享的输入/输出性能的信息。
nfsiostat 命令由 nfs-utils 包提供。

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

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

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

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

# 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 挂载点。
在这种情况下,仅生成指定挂载点的报告。

日期:2020-09-17 00:14:46 来源:oir作者:oir