Brief blog on finding out what processes are running, info taken from man.
To find out what processes are running, use the prstat utility from the command line. There are a number of options which you can make use of depending on what you what to see.
The useage of prstat is as follows:
prstat [-acJLmRtTv] [-C psrsetlist] [-j projlist]
[-k tasklist] [-n ntop[,nbottom]] [-p pidlist]
[-P cpulist] [-s key | -S key ] [-u euidlist]
[-U uidlist] [-z zoneidlist] [-Z] [interval [count]]
prstat -s cpu sorts results by process CPU useage, this is the default sort order however so does not need to be specified. Other sort options are:
- pri : process priority
- rss : resident set size
- size : size of process image
- time : process execution time
One can use -S to sort the results in ascending order using any of the above sort options, e.g. prstat -S time.
prstat -n X is handy if you only want to see the top X number of process or lwp statistics on screen. This example shows how to display the top five processes running currently:
prstat -a -n 10 is useful when trying to identify which user is consuming the most resources. The command will display the top 10 processes with a summary of the processes by user.
It is possible to identify the processes whcih are causing a performance issue (such as hogging CPU uesage) and remove these by the use of the kill command. To kill one of the processes in the above screenshot the command would be kill 28449 9, this will kill process with ID 28449 immediately.
There are some of useful utilities which work well with prstat such as mpstat (for checking CPU useage) and iostat (for checking disk useage). I’ll will post later on these as I get to grips with them.
Useful resources:
Topping top in Solaris 8 with prstat by Tom Kincaid and Andrei Dorofeev, March 2001 .
Solaris 8 Process Statistics – A “top” like tool, but better! by Solaris Internals.