From 5bf27d95b9fb7611a1acedf6e29781dc7d405b5a Mon Sep 17 00:00:00 2001 From: Ryan Doyle Date: Mon, 30 Oct 2017 11:19:37 -0400 Subject: nfsiostat: display NFS RPC queue time for mountstats and nfs-iostat Display the NFS queue statistics for mountstats and nfsiostat exported in /proc/self/mountstats. The RTT and total execution time is currently displayed but it's also useful displaying how long the task was queued for too Signed-off-by: Steve Dickson --- tools/nfs-iostat/nfs-iostat.py | 11 ++++++++--- tools/nfs-iostat/nfsiostat.man | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'tools/nfs-iostat') diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py index 577a23d..7cbe543 100644 --- a/tools/nfs-iostat/nfs-iostat.py +++ b/tools/nfs-iostat/nfs-iostat.py @@ -326,6 +326,7 @@ class DeviceData: ops = float(rpc_stats[0]) retrans = float(rpc_stats[1] - rpc_stats[0]) kilobytes = float(rpc_stats[3] + rpc_stats[4]) / 1024 + queued_for = float(rpc_stats[5]) rtt = float(rpc_stats[6]) exe = float(rpc_stats[7]) @@ -335,11 +336,13 @@ class DeviceData: retrans_percent = (retrans * 100) / ops rtt_per_op = rtt / ops exe_per_op = exe / ops + queued_for_per_op = queued_for / ops else: kb_per_op = 0.0 retrans_percent = 0.0 rtt_per_op = 0.0 exe_per_op = 0.0 + queued_for_per_op = 0.0 op += ':' print(format(op.lower(), '<16s'), end='') @@ -348,7 +351,8 @@ class DeviceData: print(format('kB/op', '>16s'), end='') print(format('retrans', '>16s'), end='') print(format('avg RTT (ms)', '>16s'), end='') - print(format('avg exe (ms)', '>16s')) + print(format('avg exe (ms)', '>16s'), end='') + print(format('avg queue (ms)', '>16s')) print(format((ops / sample_time), '>24.3f'), end='') print(format((kilobytes / sample_time), '>16.3f'), end='') @@ -356,7 +360,8 @@ class DeviceData: retransmits = '{0:>10.0f} ({1:>3.1f}%)'.format(retrans, retrans_percent).strip() print(format(retransmits, '>16'), end='') print(format(rtt_per_op, '>16.3f'), end='') - print(format(exe_per_op, '>16.3f')) + print(format(exe_per_op, '>16.3f'), end='') + print(format(queued_for_per_op, '>16.3f')) def ops(self, sample_time): sends = float(self.__rpc_data['rpcsends']) @@ -429,7 +434,7 @@ def parse_stats_file(filename): words = line.split() if len(words) == 0: continue - if line.startswith("no device mounted") : + if line.startswith("no device mounted"): continue if words[0] == 'device': key = words[4] diff --git a/tools/nfs-iostat/nfsiostat.man b/tools/nfs-iostat/nfsiostat.man index b477a9a..9ae94c5 100644 --- a/tools/nfs-iostat/nfsiostat.man +++ b/tools/nfs-iostat/nfsiostat.man @@ -90,6 +90,13 @@ This is the duration from the time that NFS client does the RPC request to its k .RE .RE .RE +.RS 8 +- \fBavg queue (ms)\fR +.RS +This is the duration from the time the NFS client created the RPC request task to the time the request is transmitted. +.RE +.RE +.RE .TP Note that if an interval is used as argument to \fBnfsiostat\fR, then the diffrence from previous interval will be displayed, otherwise the results will be from the time that the share was mounted. -- cgit