Monday, August 08, 2005

What can I do if my machine slows to a crawl or just hangs?

Subject: 6.2) What can I do if my machine slows to a crawl or just hangs?

Try running "ps" to look for large numbers of the duplicate programs or
processes with a huge size field. Some system daemons occasionally can
get into a state where they fork repeatedly and eventually swamp the
system. Killing off the child processes doesn't do any good, so you have
to find the "master" process. It will usually have the lowest pid.

Another useful approach is to run vmstat to pin down what resource(s)
your machine is running out of. You can tell vmstat to give ongoing
reports by specifying a report interval as its first argument.

The programs "top" and "sps" are good for finding processes that are
loading your system. "Top" will give you the processes that are consuming
the most cpu time. "Sps" is a better version of "ps" that runs much faster
and displays processes in an intuitive manner. Top is available at
ftp://ftp.groupsys.com/pub/top/. Sps is available at
ftp://ftp.csv.warwick.ac.uk/pub/solaris2/sps-sol2.tar.gz.

Doug Hughes <Doug dot Hughes at Eng dot Auburn dot EDU> has written a
small, quick PS workalike called "qps", available from his web page at
http://www.eng.auburn.edu/users/doug/second.html

Sometimes you run out of memory and you won't be able to run enough
commands to even find out what is wrong. You will get messages of the type
"out of memory" or "no more processes". Note that "out of memory" refers to
virtual memory, not physical memory. On a Solaris system, virtual memory
is generally equal to the sum of the swap space and the amount of physical
memory (less a roughly constant amount for the kernel) on the machine. The
command "swap -s" will tell you how much virtual memory is available.

You can sync the disks to minimize filesystem corruption if you have to
crash the system:

Use the L1-A sequence to crash the system. If you are on an older system,
type "g0" and you will get the message "panic: ... syncing file systems".
When you see the word "done", hit L1-A again and reboot. On systems
with the "new" prom, type "n" to get into the new command mode and type
"sync".

0 Comments:

Post a Comment

<< Home