Welcome to Questionaries, where you can ask questions and receive answers from other members of the community.

Let us know at info@questionaries.org

Linux, monitor read rates of files

7 like 0 dislike
I have a custom application which has a bunch of files open. I can see the file handles open by a process using "lsof" and I can see the files being accessed using "watch -d 'ls -alh'" and watching the mtime/ctime. However, I would like to see the rate of data that is being read/written to these files. IE: I need to determine if one file is being read at 100mbps and maxing out a disk. Subsequently, are there several files which are being written at 1mbps? Looking at the throughput for a specific disk isn't too useful as I need to narrow down which file is being hammered.

I'm afraid there is also a catch; ideally I need to determine this without installing any other software or writing scripts... Simply because this is one of those "very-production" systems.

Does anybody know of a way? Many thanks in advance for any suggestions.
asked 2 years ago by eagles11 (179,830 points)

1 Answer

0 like 0 dislike
 
Best answer
Check out strace. It can attach to running processes and tell you exactly what syscalls they execute and what the parameters are - with a small interpreter script, you can deduce exactly how many bytes are being read from which file handle while you watch.
answered 2 years ago by DBA-boss (120,990 points)

Related questions

2 like 0 dislike
2 answers
asked 1 year ago by Edward (33,730 points)
2 like 0 dislike
0 answers
10 like 0 dislike
1 answer
asked 2 years ago by DBA-boss (120,990 points)
14 like 0 dislike
0 answers
10 like 0 dislike
1 answer