14

I have a NFS mounted directory, and I'd like to monitor the I/O usage on it (MB/s reads and writes). What's the recommended way to do that ?

This is the NFS client, I don't have access to the NFS server. I'm not interested in general I/O usage (otherwise I would use vmstat/iostat). It also has multiple NFS mounts, I'm interested in monitoring just one specific mount (or I might have used ethereal).

Thanks!

Gordon
  • 155
  • 1
  • 1
  • 5

2 Answers2

17

nfsiostat (aka nfs-iostat.py) from nfs-utils is good for interactive monitoring. For historical data since a filesystem was mounted, use mountstats. Both of these tools read data from /proc/self/mountstats.

sciurus
  • 12,678
  • 2
  • 31
  • 49
6

iostat -mnh really is the best way to do this. It only combines stats for the same remote device. If your nfs mounts are from separate remote endpoints, then it wont combine them.

The -m means display in MB/s, the -n means to display stats for NFS shares, -h means human friendlier output.

If you pass it a number after like iostat -mnh 3 it'll display stats per every 3 seconds.

rogerdpack
  • 577
  • 2
  • 8
  • 23
phemmer
  • 5,909
  • 2
  • 27
  • 36
  • 1
    iostat doesn't accept the -m option on my system. – Good Person Feb 03 '11 at 02:16
  • -m might be a gnu option then – phemmer Feb 03 '11 at 02:46
  • I've found iostat to be a poor choice for obtaining IO data over short intervals because my implementation (sysstat-7.0.2-3.e15) only ever shows wBlk_svr/s as a rate since boot time. I like to think that newer versions can show this as a counter instead. – ericslaw Jul 14 '11 at 23:15
  • 6
    What platform are we talking about? Iostat is platform dependent. The -n (network filesystem) option was deprecated in Linux iostat. It's gone in the version I see (RHEL 7.2) – John M Aug 24 '16 at 15:50