如何监控 CIFS 文件系统上的读/写请求?

如何监控 CIFS 文件系统上的读/写请求?

有没有办法监控 CIFS 安装文件系统上的读/写请求?我有一个使用 Azure 文件的容器,其文件系统通过 CIFS 挂载。我在 Azure 上的读/写事务成本高于预期,我想查看哪些进程正在文件系统上读/写文件。

答案1

您可以使用fatrace它来监视所有磁盘 io,或者-c仅监视当前目录的文件系统。

$ cd /tmp; sudo fatrace -c -t
11:27:55.404188 bash(28844): O /tmp
11:27:55.404188 bash(28844): R /tmp
11:27:55.404188 bash(28844): R /tmp
11:27:55.404574 bash(28844): C /tmp
11:28:01.711543 upsc(32404): CO /tmp
11:28:03.044996 bash(32405): O /tmp/output
11:28:03.070504 conky(32405): RO /tmp/conky
11:28:03.071178 conky(32405): C /tmp/conky
11:28:03.072308 conky(32405): W /tmp/output
11:28:06.131741 unknown(32405): CW /tmp/output

事件按其首字母显示:打开关闭阅读写作

对于简单的每秒总体读/写统计数据,有cifsiostat.

相关内容