How to monitor which files are accessed through NFS?

6,145

You can use either lsof or ftop (the last one is on EPEL repo)

For example:

lsof -N /mnt/nfs/*

HTH

Share:
6,145

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin almost 2 years

    I have a linux file server running CentOS 6. Files are accessed via NFS4.

    Sometimes I have problems with disk io load. I want to find out what is causing them.

    I can find out which client is causing them with tcpdump and nfsiostat (on the clients). But I want to know either which files are accessed or which process is doing the accesses. Then I can think about a solution for it.

    I have tried to use wireshark to decode the accesses, but it is hard to read when open and read/write are not close together or you have lots of files with similar names (directories are not shown, just dir handles). If you have a lot of activity it would be nice to have a way to sort files by activity to find out what is the culprit.

    Does anybody know of a solution for this?

    • Admin
      Admin almost 12 years
      Do you want to look on the client or the server?
    • Admin
      Admin over 5 years
      I have the same problem and want to find out on the server.
  • DarkNeuron
    DarkNeuron over 5 years
    A late comment, but this seems to be for local disks, and not NFS.