Why one should not use prstat -a command on solaris to find resource consuming process?

Hi,

For e.g If we have 2 databases on a solaris Intel x86 system each with sga 2gb and 1 gb respectively.

Then if we use prstat -a command to determine most CPU Or Memory consuming process we get the following output.

NPROC USERNAME SIZE RSS MEMORY TIME CPU
7 ctsmrc1 983M 200M 0.3% 3:34:32 4.0%
32 ora10g 64G 61G 99% 0:00:05 0.1%
4 daemon 10M 6048K 0.0% 0:13:07 0.1%
28 ctsdb 1225M 202M 0.3% 0:02:15 0.0%
14 mqm 335M 59M 0.1% 0:00:19 0.0%
7 ctsap1 456M 40M 0.1% 0:00:32 0.0%
1 smmsp 6352K 1420K 0.0% 0:00:00 0.0%
1 nobody 4132K 2764K 0.0% 0:00:00 0.0%
1 lp 2644K 1064K 0.0% 0:00:00 0.0%
21 ctsshr 743M 107M 0.2% 0:01:27 0.0%
46 root 177M 107M 0.2% 0:01:38 0.0%

From the above output, It seems that prstat -a does not give true picture of memory usage.
This is because prstat -a sorts the memory processes on the basis of users.
So if we have ora10g user under which there are 2 database each of sga 2gb and 1gb then all the background processes which are already part of sga are counted as the seperate processes of user ora10g and hence each of the background process or processes associated with sga and comes under user ora10g is counted as consuming 2gb or 1gb respectively giving the false impression that user ora10g is consuming 64G of memory which is not true and not possible.

Hence in order to use prstat to determine top CPU or Memory consuming processes use the following commands

to sort the processes based on the CPU consummed use the following command

#prstat -s cpu -n 10 (to determine top 10 cpu consuming processes)

to sort the processes based on the memory size use the following command

#prstat -s size -n 10 (to determine top 10 memory consuming processes)

Also, to determine the resource consumption in Solaris preferably use vmstat and top command which gives true indication of resource which is described in my previous articles.

Leave a Reply


Close
E-mail It