Join 3,556 readers in helping fund MetaFilter (Hide)


Linux troubleshooting
December 2, 2010 1:00 PM   Subscribe

Linux i/o bottleneck troubleshooting issue:

There is I/O starvation on a filesystem. Example: /mnt.
There are two files on the filesystem fs: /mnt/a and /mnt/b.

How will you find which one of them gets most read/writes even if both of them are currently open by some process?

I thought the sysstat tools would help me here, but i think I might be going in the wrong direction.

I'm a bit embarrassed to be asking this because it's something I should know, but I'm going completely blank. I know it's something simple, but both my brain and google are failing me. Thanks.
posted by Cat Pie Hurts to Computers & Internet (4 answers total) 3 users marked this as a favorite
 
You may have some luck with atop. It gives per disk statistics including reads, writes, and MiB/S for reads and writes.
posted by MasterShake at 1:21 PM on December 2, 2010


So you're saying that one process is accessing both files and you want to know which one its getting more IO? I would use 'lsof -p PID' to determine the fds of the two files and then 'strace -p PID -o filename' to record some activity, then detach with ^C after a while. You can reduce the output to just the read/write syscalls by adding '-e read,write'. The first arg of the syscall is the fd which you map back to the filename by the output of lsof, so you can use that with your favorite text processing tools to sum the activity by number of calls or bytes or whatever.

You might also try the new 'trace' command.
posted by Rhomboid at 1:49 PM on December 2, 2010


I think "iostat -N" would be helpful.
posted by jrishel at 11:19 AM on December 3, 2010


Wow. I completely forgot that I had posted this. Sorry about that!

Strace was what I had initially gone with, but the person asking the question was actually looking for was whether I had experience withSystemTap, which I hadn't touched in a while due to stability issues (though it looks fairly stable now).
posted by Cat Pie Hurts at 8:31 AM on January 26, 2011


« Older Should I throw in the towel?...   |  Can one use beer as their only... Newer »
This thread is closed to new comments.