Hopefully your disk is partitioned... this wil help narrow down the
culprit. To monitor activity long term, you need to install sar, and
schedule sadm to collect data that you can later analyse.

In the short term, there is one ( maybe two depending on distro ), tool to
use: vmstat(iostat) and ps. To monitor, use vmstat 5. This will provide
stats ( with varying format depending on age of the tool ) on what's
happening every 5 seconds ( don't refresh at less thn 4 sec intervals as a
lot of counters don't get updated that often ).

output is in blocks. Here's the header
   procs                      memory    swap          io     system       
 cpu
 r  b  w   swpd   free   buff  cache  si  so    bi    bo   in    cs  us 
sy  id


1. procs the number of processes Running, Blocked on IO and Waiting to run.
mem
2. Memory, number of 512byte blocks Swapped, Free, Buffered and Cache
3. Swap number of processes Swapped In and Out ( per second )
4. IO nuber of blocks of data Input and Output per second
5. System. Number of Interrupts and Context Switches per second.
6. CPU percentage in User, System and Idle ( *should* total 100! ).

Procs: It's rare to see a value over 2 in any of these columns. More needs
investigation
Memory: Not too interesting. Expect to see a low value in the free column,
or you've either got loads of memory, or things aren't working right ( or
you've just booted the pc up ).
IO: Values in the hundreds are surprising for a PC.
System: Interrupts - when something happens that needs an action, and
context switches - the os checking programs to see if it wants to do
something... rates of low hundreds per second are ok, thousands is worse!

But the best thing to do with this is to have it running and then try to
start up firefox: see which values increase. It may point to a lack of
memory causing excessive swapping, rather than a process hogging the disk.

The other thing to look for is what processes are actually running.
Default installs can include databases, web servers, ssh servers - some or
all of which are completely unnecessary to your day-to-day use of your
computer.

( vmstat -d 5 is great if it works as it gives loads of disk activity. )

ps alwx   provides a per process snapshot as well. Useful columns include
VSZ: The virtual amount of memory this process uses ( Virtual Set Size )
RSS: The physical amount of memory this process uses ( Resident Set Size )
WCHAN: address of the kernel function where the process is sleeping ( ie
what it is about to do...sort of )
STAT: Process state. ( from the man page... )
<    high-priority (not nice to other users)
N    low-priority (nice to other users)
L    has pages locked into memory (for real-time and custom IO)
s    is a session leader
l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
+    is in the foreground process group


As for updatedb... personally I'd uninstall it!

Steve.

On Thu, November 3, 2005 10:16 am, Phill Coxon wrote:
> Occassionally on my new server (Mandrake 2006) something starts a *lot*
> of disk activity causing the desktop to get very sluggish for 5 minutes
> or so.  Very likely some database indexing files on the drive.
>
> CPU load remains very low - it's just the disk being thrashed that
> causes everything else to slow down significantly. Loading Firefox will
> take 45 seconds instead of 3-5 seconds for example.
>
> Two questions:
>
> 1) Is there any simple way of determining which process is associated
> with significant disk activity?
>
> 2) What solutions are available for reducing desktop sluggishness
> because some database or other is reindexing?  Would moving key data
> directories (/home) to a separate drive away from application binaries
> help?
>
> Thanks.
>
>
>
>


-- 
Work like you don't need the money,
Love like your heart has never been broken and
Dance like no one can see you.

Reply via email to