What command on Solaris will allow me to see what process is taking up
what
percentage of my CPU?
I am familiar with the "ps -e" command, but it doesn't tell me what
resource is
taking up all the memory to cause my system to be so slow. Thanks.
ps -ef will show you what's running on the system and the CPU time used.
It's pretty crude but will give you a general idea what's going on.
See man sar!
Also consider what hardware you are running! You didn't mention it.
There are some real antiques around that will not impress anyone with
their performance. (Sometimes those ten year old boxes run their ten
year old applications and deliver adequate performance.)
Performance monitoring and tuning is a little too complex for adequate
treatment in a newsgroup. Especially so with the pittance of
information you have provided.
"top" is usually the best tool for quickly finding CPU hogs. It isn't
part of Solaris 8, but you can get one from www.sunfreeware.com.
"Usually" because it will not pick up the case where a large number of
jobs are running at high CPU for a tiny fraction of a second.
It might also be a disk IO issue, in which case iostat is your friend.
It might also be a busy network interface, in which case "netstat -ai"
should help.
Regards,
David Mathog
This script sorts the processes based on cpu usage (to sort on memory
usage instead, change the "4" to "5" in the sort command line):
#! /bin/sh
#
# @(#)psnice - sort processes by cpu usage and show some other resources
#
# The linux ps complained about the -c option, and the "-g 1" ps command
# matched several processes (leading to the use of "| head -1").
#
PSFMTh='-o user,pid,ppid,pcpu,pmem,nice,pri,stime=START -o time,comm'
PSFMTnh='-o user= -o pid= -o ppid= -o pcpu= -o pmem= -o nice= -o pri= -o stime= -o time= -o comm='
ps -g 1 ${PSFMTh} | head -1
ps -e ${PSFMTnh} | sort -n -r -k 4
HTH,
Chuck
http://developers.sun.com/solaris/articles/prstat.html.
this article can give you a good understanding of the command.