Friday, October 26, 2012

Check utilization for Solaris 10

Seems "top" is not available (or not installed by default). Actually there is another command "prstat" which provide similar but more powerful functions:

#prstat -Z
   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP
  5147 root      206M   33M sleep   59    0   0:03:10 0.0% webservd/30
  1378 noaccess  157M  129M sleep   59    0   0:02:41 0.0% java/18
  2333 root      130M   90M sleep   59    0   0:07:52 0.0% java/72
  5060 root       82M   14M sleep   59    0   0:03:11 0.0% webservd/71
  5088 106        81M   20M sleep   59    0   0:03:11 0.0% webservd/72
  1865 root       63M   24M sleep  101    -   0:00:04 0.0% rgmd/43
  1009 root       51M   24M sleep   59    0   0:00:22 0.0% fmd/30
  1719 root       48M 4080K sleep  100    -   0:00:19 0.0% rpc.pmfd/23
  1119 root       44M   28M sleep   59    0   0:34:05 0.0% poold/8
    11 root       36M   29M sleep   59    0   0:00:30 0.0% svc.startd/13
  5094 root       34M   16M sleep   59    0   0:00:50 0.0% opceca/2
   861 root       28M 3520K sleep   59    0   0:00:00 0.0% pmmd/20
  5146 root       26M 3344K sleep   59    0   0:00:07 0.0% webservd/2
  5087 root       26M 2976K sleep   59    0   0:00:07 0.0% webservd/2
  5059 root       26M 2600K sleep   59    0   0:00:07 0.0% webservd/2
ZONEID    NPROC  SWAP   RSS MEMORY      TIME  CPU ZONE
     0       95  734M  566M   0.9%   1:05:10 0.0% global
     1       37  275M  112M   0.2%   0:10:00 0.0% zone1
     3       44  113M  112M   0.2%   3:18:50 0.1% zone2
     2       23   18M   26M   0.0%   0:01:21 0.0% zone3

Total: 199 processes, 4159 lwps, load averages: 0.43, 0.39, 0.38


Note that I run this command one a container with 3 zones. The -Z parameter provide a glance of the utilization of each zone. To view the utilization of an individual zone, you can run "prstat -z ":



   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP
  3676 root     6184K 1656K sleep   59    0   0:00:00 0.0% dtlogin/1
  3504 root     3696K 1840K sleep   59    0   0:00:00 0.0% nscd/19
  3758 root     2992K 1248K sleep   59    0   0:00:00 0.0% ttymon/1
  3489 root     3248K 1608K sleep   59    0   0:00:01 0.0% cron/1
  3617 root     2856K  392K sleep   59    0   0:00:00 0.0% smcboot/1
  3750 root     4208K 1824K sleep   59    0   0:00:00 0.0% dmispd/2
  3588 root     3536K 1256K sleep   59    0   0:00:00 0.0% arraymon/1
  3461 root     4240K 2032K sleep   59    0   0:00:00 0.0% automountd/2
  3450 daemon   3168K 1800K sleep   59    0   0:00:00 0.0% lockd/2
  3451 daemon   3440K 1904K sleep   59    0   0:00:00 0.0% statd/1
  3435 root     3536K 1552K sleep   59    0   0:00:00 0.0% inetd/1
  3411 root     3360K 1088K sleep   59    0   0:00:00 0.0% rpcbind/1
  3553 root     2216K  904K sleep   59    0   0:00:00 0.0% utmpd/1
  3755 root     2936K 1304K sleep   59    0   0:00:00 0.0% sac/1
  3307 root     3312K 1488K sleep   59    0   0:00:00 0.0% picld/4
  3743 root     3496K 1784K sleep   59    0   0:00:00 0.0% snmpdx/1
  3756 root     2928K  976K sleep   59    0   0:00:00 0.0% ttymon/1
  3093 root     3416K 1576K sleep   59    0   0:00:00 0.0% init/1
  2831 root        0K    0K sleep   60    -   0:00:00 0.0% zsched/1
  3615 root     2856K  808K sleep   59    0   0:00:00 0.0% smcboot/1
  3474 root     4584K 1584K sleep   59    0   0:00:00 0.0% syslogd/13
Total: 23 processes, 65 lwps, load averages: 0.35, 0.38, 0.38


It's worth to explore other parameter such as sort by memory (prstat -s size), by cpu (prstat -s cpu). You can refer to the man page:

http://docs.oracle.com/cd/E19082-01/819-2240/prstat-1m/index.html 



No comments: