From: David Cowie on
gkrellm tells me how busy my hard disk and CPU are.
top tells me what's using my CPU time and memory.
Are there any programs (GUI or command line) that will tell me which
programs are reading from and writing to my disks? Every now and again
the HD will burst into life, with nothing obvious showing on top, and I'd
like to know what's going on.

--
David Cowie

Containment Failure + 35310:32
From: spike1 on
David Cowie <me(a)privacy.net> did eloquently scribble:
> gkrellm tells me how busy my hard disk and CPU are.
> top tells me what's using my CPU time and memory.
> Are there any programs (GUI or command line) that will tell me which
> programs are reading from and writing to my disks? Every now and again
> the HD will burst into life, with nothing obvious showing on top, and I'd
> like to know what's going on.

lsof
(LiSt Open Files)
It lists all processes holding file handles, all processes with open sockets
and all processes with open (or listening) network connections.

The bursting into life of the hard disk could just be the virtual memory
routines in the kernel doing a little swapping. If processes lie idle for a
time, they can by swapped out, freeing memory for more useful things like
cache until they're needed.
--
-----------------------------------------------------------------------------
| spike1(a)freenet.co.uk | Windows95 (noun): 32 bit extensions and a |
| | graphical shell for a 16 bit patch to an 8 bit |
|Andrew Halliwell BSc(hons)| operating system originally coded for a 4 bit |
| in |microprocessor, written by a 2 bit company, that|
| Computer Science | can't stand 1 bit of competition. |
-----------------------------------------------------------------------------
From: Nix on
On 25 Nov 2007, spike1(a)freenet.co.uk spake thusly:

> David Cowie <me(a)privacy.net> did eloquently scribble:
>> gkrellm tells me how busy my hard disk and CPU are.
>> top tells me what's using my CPU time and memory.
>> Are there any programs (GUI or command line) that will tell me which
>> programs are reading from and writing to my disks? Every now and again
>> the HD will burst into life, with nothing obvious showing on top, and I'd
>> like to know what's going on.
>
> lsof
> (LiSt Open Files)
> It lists all processes holding file handles, all processes with open sockets
> and all processes with open (or listening) network connections.

This does not cover all entities which can write to the disk. A majority of
my drive writes are journal updates, writes over NFS, and md-thread-initiated
superblock updates. (atime updates are also not coverd but if you care about
performance you won't have many of those.)

You want the blktrace package (you might need to recompile the kernel and
enable CONFIG_BLK_DEV_IO_TRACE).

--
`Some people don't think performance issues are "real bugs", and I think
such people shouldn't be allowed to program.' --- Linus Torvalds
From: David Cowie on
On Sun, 25 Nov 2007 10:39:55 +0000, spike1 wrote:

> lsof
> (LiSt Open Files)
> It lists all processes holding file handles, all processes with open
> sockets and all processes with open (or listening) network connections.

Piping lsof into less reveals a report of over 4000 lines. That's a bit
more detail than I was looking for.

--
David Cowie

Containment Failure + 35333:51
From: spike1 on
David Cowie <me(a)privacy.net> did eloquently scribble:
> On Sun, 25 Nov 2007 10:39:55 +0000, spike1 wrote:

>> lsof
>> (LiSt Open Files)
>> It lists all processes holding file handles, all processes with open
>> sockets and all processes with open (or listening) network connections.

> Piping lsof into less reveals a report of over 4000 lines. That's a bit
> more detail than I was looking for.

well, you can pipe through grep to exclude stuff you don't want.

ridcully:~ # lsof | wc -l
2154
ridcully:~ # lsof | grep DIR | wc -l
181

--
______________________________________________________________________________
| spike1(a)freenet.co.uk | "Are you pondering what I'm pondering Pinky?" |
|Andrew Halliwell BSc(hons)| |
| in | "I think so brain, but this time, you control |
| Computer Science | the Encounter suit, and I'll do the voice..." |
------------------------------------------------------------------------------