13 Popular Unix prstat command examples (Solaris 10/11) for Beginners

In this article, I will take you through 13 Popular Unix prstat command examples. You might have used top command in Unix based system to check the memory and cpu utilization but what will you do when i will ask to check the zones cpu and memory utilization ? There comes prstat command to our rescue which can provide zone wise utilization report. This command will also show User based and PID based utilization. You can also use prstat command to find out the process causing memory and cpu spike regularly and can cap/adjust your utilization as per your requirements. We will go through all the prstat command usages in below examples.

Below are the terminology used in prstat command output.

  • PID : The process ID of the process.
  • USERNAME : The real user (login) name or real user ID.
  • SWAP: The sum of swap reservations of the associated processes for each user, project, task, or zone.
  • RSS : The resident set size of the process (RSS), in kilobytes (K), megabytes (M), gigabytes (G), or terabytes (T).
  • STATE: The state of the process
  • PRI : The priority of the process. Larger numbers mean higher priority.
  • NICE : Nice value used in priority computation. Only processes in certain scheduling classes have a nice value.
  • TIME : The cumulative execution time for the process.
  • CPU : The percentage of recent CPU time used by the process.
  • PROCESS: The name of the process (name of executed file).
  • LWPID: The lwp ID of the lwp being reported.
  • NLWP: The number of lwps in the process.
  • NPROC: Number of processes in a specified collection.
  • MEMORY: Percentage of memory used by a specified collection of processes.
  • USR: The percentage of time the process has spent in user mode.
  • SYS: The percentage of time the process has spent in system mode.
  • TRP: The percentage of time the process has spent in processing system traps.
  • TFL: The percentage of time the process has spent processing text page faults.
  • DFL: The percentage of time the process has spent processing data page faults.
  • LCK: The percentage of time the process has spent waiting for user locks.
  • SLP: The percentage of time the process has spent sleeping.
  • LAT: The percentage of time the process has spent waiting for CPU.
  • VCX: The number of voluntary context switches.
  • ICX: The number of involuntary context switches.
  • SCL: The number of system calls.
  • SIG: The number of signals received.
  • LGRP: The home lgroup of the process or lwp.

Synopsis

prstat [-acLmRtv] [-C psrsetlist] [-n nprocs[,nusers]] [-p pidlist] [-P cpulist] [-s key | -S key ] [-u euidlist] [-U uidlist] [interval [count]]

13 Popular Unix prstat command examples (Solaris 10/11) for Beginners 1

Unix prstat command examples

Also Read: Top 31 ZFS File System Commands Every Unix Admin Should Know

Example 1: How to check complete users resource utilization using prstat command in UNIX

If you want to check all the users resource utilization then you need to use prstat -t command as shown below. You can check nproc, RSS, Memory and CPU Utilization for every user from below output.

root@localhost:~# prstat -t
NPROC USERNAME   SWAP     RSS   MEMORY   TIME   CPU
61     root     440668K 389688K 15.01% 0:02:14 0.851%
4     netadm     9356K  20464K  0.788% 0:00:00 0.009%
4    webservd   20416K  31040K  1.195% 0:00:00 0.006%
2    noaccess    2164K  11540K  0.444% 0:00:00 0.000%
1      smmsp     3012K  9156K   0.353% 0:00:00 0.000%
3     daemon     3896K  12396K  0.477% 0:00:00 0.000%

-t : Report total usage summary for each user. More on prstat command Man Page.

NOTE:

Advertisements
Please note that here I am using root user to run all the below commands.You can use any user with sudo access to run all these commands. For more information Please check Step by Step: How to Add User to Sudoers to provide sudo access to the User.

Example 2: How to check Project wise resource utilization using prstat command in UNIX

If you want to check project wise resource utilization then you need to use prstat -J command as shown below. As you can see from below output, you can check RSS, Memory, PRI, NICE and CPU Utilization for every Process based on its PID(Process Id) and in a separate section you can see the same information about the Projects based on its Project ID.

root@localhost:~# prstat -J
PID   USERNAME   SIZE      RSS   STATE PRI NICE   TIME    CPU   PROCESS/NLWP
815    root    178912K   163224K sleep 59   0    0:00:43 0.214% sstored/16
5      root       0K       0K    sleep 99  -20   0:00:03 0.092% zpool-rpool/166
1164   root      5452K    3864K  cpu1  49   0    0:00:00 0.061% prstat/1
1155   root     16108K    8584K  sleep 59   0    0:00:00 0.021% sshd/1
809    root     5708K     2808K  sleep 59   0    0:00:00 0.021% hald-addon-acpi/1
799    root     10656K    7524K  sleep 59   0    0:00:00 0.021% hald/4
1159   root     5500K     3476K  sleep 49   0    0:00:00 0.015% bash/1
956    root     28316K    13620K sleep 59   0    0:00:00 0.015% sysstatd/14
804    root     14412K    4776K  sleep 59   0    0:00:00 0.006% httpd/1
323    root     15108K    8724K  sleep 59   0    0:00:00 0.006% devfsadm/5
812   webservd  24008K    8812K  sleep 59   0    0:00:00 0.006% httpd/18
621    root     21900K    7812K  sleep 59   0    0:00:02 0.006% nscd/42
15     root     74776K    70744K sleep 59   0    0:01:08 0.006% svc.configd/30
864    root    141776K    51576K sleep 59   0    0:00:03 0.003% fmd/45
603   netadm    18352K    10244K sleep 59   0    0:00:00 0.003% nwamd/8
853   daemon    6308K     4024K  sleep 59   0    0:00:00 0.000% rpcbind/1
215   daemon    3508K     1316K  sleep 59   0    0:00:00 0.000% utmpd/1
655   root     11948K     1372K  sleep 59   0    0:00:00 0.000% sshd/1
324   root     4608K      2076K  sleep 60  -20   0:00:00 0.000% zonestatd/5
980   root     16648K     2540K  sleep 59   0    0:00:00 0.000% sendmail/1
754   root       0K        0K    sleep 99  -20   0:00:00 0.000% zpool-tpool/166
256   root     11536K     4644K  sleep 59   0    0:00:00 0.000% syseventd/18
207   root     3744K      1620K  sleep 59   0    0:00:00 0.000% hotplugd/2
273   root     5484K      2512K  sleep 59   0    0:00:00 0.000% dbus-daemon/1
PROJID NPROC   SWAP    RSS   MEMORY   TIME    CPU  PROJECT
0       68   470260K 409116K 15.76% 0:02:14 0.400% system
1       5     7540K  26604K  1.025% 0:00:00 0.098% user.root
3       2     1576K  11976K  0.461% 0:00:00 0.000% default

-J : Report information about processes and projects. More on prstat command Man Page.

Example 3: How to show summary per local zone using prstat command in Unix

If you want to show summary per local zone then you need to use prstat -Z command as shown below. In the below output you can check all the process memory and cpu utilization with a separate section showing Zone based memory and cpu utilization.

root@localhost:~# prstat -Z
PID  USERNAME  SIZE    RSS    STATE  PRI  NICE   TIME    CPU    PROCESS/NLWP
5     root      0K     0K     sleep  99   -20  0:00:04  0.195%  zpool-rpool/166
815   root    179012K 163328K sleep  59    0   0:00:43  0.174%  sstored/16
1165  root    5448K   3860K   cpu0   49    0   0:00:00  0.134%  prstat/1
1155  root    16124K  8592K   sleep  59    0   0:00:00  0.027%  sshd/1
1159  root    5500K   3476K   sleep  49    0   0:00:00  0.024%  bash/1
138   root    13540K  8460K   sleep  59    0   0:00:01  0.018%  sysobjd/9
956   root    28316K  13620K  sleep  59    0   0:00:00  0.012%  sysstatd/14
809   root    5708K   2812K   sleep  59    0   0:00:00  0.009%  hald-addon-acpi/1
799   root    10656K  7524K   sleep  59    0   0:00:00  0.009%  hald/4
804   root    14412K  4776K   sleep  59    0   0:00:00  0.006%  httpd/1
812  webservd 24008K  8812K   sleep  59    0   0:00:00  0.006%  httpd/18
323   root    15108K  8724K   sleep  59    0   0:00:00  0.003%  devfsadm/5
621   root    21900K  7812K   sleep  59    0   0:00:02  0.003%  nscd/42
13    root    36100K  19616K  sleep  59    0   0:00:14  0.003%  svc.startd/13
853  daemon   6308K   4024K   sleep  59    0   0:00:00  0.000%  rpcbind/1
215  daemon   3508K   1316K   sleep  59    0   0:00:00  0.000%  utmpd/1
655   root    11948K  1372K   sleep  59    0   0:00:00  0.000%  sshd/1
324   root    4608K   2076K   sleep  60   -20  0:00:00  0.000%  zonestatd/5
603  netadm   18352K  10244K  sleep  59    0   0:00:00  0.000%  nwamd/8
980   root    16648K  2540K   sleep  59    0   0:00:00  0.000%  sendmail/1
754   root     0K      0K     sleep  99   -20  0:00:00  0.000%  zpool-tpool/166
256   root    11536K  4644K   sleep  59    0   0:00:00  0.000%  syseventd/18
207   root    3744K   1620K   sleep  59    0   0:00:00  0.000%  hotplugd/2
273   root    5484K   2512K   sleep  59    0   0:00:00  0.000%  dbus-daemon/1
98    root    12940K  4636K   sleep  59    0   0:00:00  0.000%  in.mpathd/1
109  daemon   11008K  1788K   sleep  60   -20  0:00:00  0.000%  kcfd/3
742   root    10776K  1284K   sleep  59    0   0:00:00  0.000%  iscsid/2
162   root    3888K   1756K   sleep  59    0   0:00:00  0.000%  pfexecd/3
68   netadm   7244K   4504K   sleep  59    0   0:00:00  0.000%  ipmgmtd/7
104   root    5432K   3028K   sleep  59    0   0:00:00  0.000%  in.ndpd/1
ZONEID NPROC  SWAP      RSS   MEMORY  TIME     CPU  ZONE
0       74    478796K 417684K 16.09% 0:02:15 0.626% global

-Z : Report information about processes and zones. More on prstat command Man Page.

Example 4: How to Sort memory by Resident set Size using prstat command in Unix

If you want to sort memory by Resident set size then you need to use prstat -s rss command as shown below. As you can see from below output, processes are sorted in descending order based on their RSS size.

root@localhost:~# prstat -s rss
PID USERNAME  SIZE     RSS    STATE PRI NICE TIME     CPU   PROCESS/NLWP
815  root    179268K  163576K sleep 59   0   0:00:44 0.189% sstored/16
15   root    74776K   70744K  sleep 59   0   0:01:08 0.003% svc.configd/30
864  root    141776K  51576K  sleep 59   0   0:00:03 0.000% fmd/45
13   root    36100K   19616K  sleep 59   0   0:00:14 0.000% svc.startd/13
956  root    28316K   13620K  sleep 59   0   0:00:00 0.015% sysstatd/14
276  root    23152K   10508K  sleep 59   0   0:00:00 0.000% rad/10
819 webservd 24252K   10408K  sleep 59   0   0:00:00 0.000% httpd/28
603  netadm  18352K   10244K  sleep 59   0   0:00:00 0.000% nwamd/8
817 webservd 24132K   9596K   sleep 59   0   0:00:00 0.000% httpd/28
818 webservd 24132K   9580K   sleep 59   0   0:00:00 0.000% httpd/28
812 webservd 24008K   8812K   sleep 59   0   0:00:00 0.006% httpd/18
323  root    15108K   8724K   sleep 59   0   0:00:00 0.000% devfsadm/5
1155 root    16124K   8592K   sleep 59   0   0:00:00 0.018% sshd/1
138  root    13540K   8460K   sleep 59   0   0:00:01 0.000% sysobjd/9
621  root    21900K   7812K   sleep 59   0   0:00:02 0.003% nscd/42

-s : Sort output lines (that is, processes, lwps, or users) by key in descending order. Only one key can be used as an argument. More on prstat command Man Page.

Example 5: How to Sort process by the process size using prstat command in Unix

If you want to sort process by the process size then you need to use prstat -s size command as shown below. As you can see from below output, processes are showing in descending order based on their sizes.

root@localhost:~# prstat -s size
PID USERNAME  SIZE     RSS   STATE PRI NICE  TIME    CPU   PROCESS/NLWP
815  root    179416K 163732K sleep 59   0   0:00:44 0.253% sstored/16
864  root    141776K 51576K  sleep 59   0   0:00:03 0.003% fmd/45
15   root    74776K  70744K  sleep 59   0   0:01:08 0.000% svc.configd/30
13   root    36100K  19616K  sleep 59   0   0:00:14 0.006% svc.startd/13
956  root    28316K  13620K  sleep 59   0   0:00:00 0.021% sysstatd/14
819 webservd 24252K  10408K  sleep 59   0   0:00:00 0.000% httpd/28
817 webservd 24132K  9596K   sleep 59   0   0:00:00 0.000% httpd/28
818 webservd 24132K  9580K   sleep 59   0   0:00:00 0.000% httpd/28
812 webservd 24008K  8812K   sleep 59   0   0:00:00 0.006% httpd/18
276  root    23152K  10508K  sleep 59   0   0:00:00 0.000% rad/10
621  root    21900K  7812K   sleep 59   0   0:00:02 0.000% nscd/42
603 netadm   18352K  10244K  sleep 59   0   0:00:00 0.000% nwamd/8
980  root    16648K  2540K   sleep 59   0   0:00:00 0.000% sendmail/1
1155 root    16124K  8592K   sleep 59   0   0:00:00 0.049% sshd/1

Example 6: How to Sort Process by CPU Usage using prstat command in Unix

If you want to sort process by CPU Usage then you need to use prstat -s cpu command as shown below. As you can see from below output, processes are showing in the descending order based on their CPU Utilization.

root@localhost:~# prstat -s cpu
PID  USERNAME  SIZE     RSS   STATE PRI NICE  TIME    CPU   PROCESS/NLWP
815   root    179432K 163748K sleep 59   0   0:00:44 0.180% sstored/16
5     root      0K      0K    sleep 99  -20  0:00:04 0.070% zpool-rpool/166
1155  root    16124K   8596K  sleep 59   0   0:00:00 0.046% sshd/1
1168  root    5452K    3864K  cpu1  59   0   0:00:00 0.046% prstat/1
809   root    5724K    2828K  sleep 59   0   0:00:00 0.021% hald-addon-acpi/1
1159  root    5500K    3476K  sleep 49   0   0:00:00 0.015% bash/1
956   root    28316K   13620K sleep 59   0   0:00:00 0.015% sysstatd/14
799   root    10656K   7524K  sleep 59   0   0:00:00 0.012% hald/4
812 webservd  24008K   8812K  sleep 59   0   0:00:00 0.009% httpd/18
804   root    14412K   4776K  sleep 59   0   0:00:00 0.006% httpd/1
98    root    12940K   4636K  sleep 59   0   0:00:00 0.006% in.mpathd/1
13    root    36100K   19616K sleep 59   0   0:00:14 0.006% svc.startd/13
323   root    15108K   8724K  sleep 59   0   0:00:00 0.003% devfsadm/5

Example 7: How to show memory usage per users using prstat command in Unix

If you want to show memory usage per users then you need to use prstat -n 1 -a command as shown below. Here we are restricting all the processes memory and cpu utilization output to 1 Line. You can also notice from below output that the user based memory and cpu utilization output showing in different section are not restricted.

root@localhost:~# prstat -n 1 -a
PID USERNAME  SIZE      RSS   STATE PRI NICE   TIME   CPU    PROCESS/NLWP
815  root    179616K  163928K sleep 59    0   0:00:44 0.433% sstored/16
NPROC USERNAME SWAP      RSS   MEMORY TIME     CPU
60      root   440956K 388748K 14.97% 0:02:16 0.928%
4     webservd 20416K  31040K  1.195% 0:00:00 0.009%
4      netadm  9356K   20464K  0.788% 0:00:00 0.003%
1      smmsp   3012K   9156K   0.353% 0:00:00 0.000%
3     daemon   3896K   12396K  0.477% 0:00:00 0.000%
Total: 74 processes, 785 lwps, load averages: 0.05, 0.41, 0.35

-n : Restrict number of output lines. More on prstat command Man Page.
-a : Report information about processes and users. More on prstat command Man Page.

Example 8: How to show memory usage for every Zone using prstat command in Unix

If you want to show memory usage for every Zone then you need to use prstat -n 1 -Z command as shown below. In this example, we are showing the memory utilization of a Zone and restricting the output to 1 Line.

root@localhost:~# prstat -n 1 -Z
PID USERNAME SIZE      RSS   STATE PRI NICE  TIME    CPU   PROCESS/NLWP
815  root    179628K 163940K sleep 59   0   0:00:44 0.201% sstored/16
ZONEID NPROC  SWAP      RSS   MEMORY  TIME     CPU  ZONE
0       74    479436K 418324K 16.11% 0:02:16 0.488% global

Example 9: How to print new reports below previous reports using prstat command in Unix

If you want to show new reports on top of previous reports then you need to use prstat -c command as shown below. This command will prevent any report overlapping and hence gives you the new as well as previous reports.

root@localhost:~# prstat -c
Please wait...
PID  USERNAME SIZE      RSS    STATE PRI NICE   TIME     CPU  PROCESS/NLWP
815  root     180396K  164704K sleep 59    0   0:00:49 0.290% sstored/16
5    root     0K        0K     sleep 99   -20  0:00:05 0.275% zpool-rpool/166
1155 root     16124K   8600K   sleep 49    0   0:00:00 0.125% sshd/1
1159 root     5500K    3544K   sleep 49    0   0:00:00 0.089% bash/1
1183 root     5000K    3496K    cpu1 49    0   0:00:00 0.070% prstat/1
956  root     28316K   13620K  sleep 59    0   0:00:00 0.018% sysstatd/14
812  webservd 24008K   8812K   sleep 59    0   0:00:00 0.009% httpd/18
809  root     5804K    2904K   sleep 59    0   0:00:00 0.006% hald-addon-acpi/1
804  root     14412K   4776K   sleep 59    0   0:00:00 0.006% httpd/1
323  root     15108K   8724K   sleep 59    0   0:00:00 0.006% devfsadm/5
799  root     10656K   7524K   sleep 59    0   0:00:01 0.003% hald/4
614  netadm   13544K   5432K   sleep 59    0   0:00:00 0.003% dhcpagent/1
51   root     7300K    4640K   sleep 59    0   0:00:00 0.003% dlmgmtd/7
138  root     13540K   8460K   sleep 59    0   0:00:01 0.000% sysobjd/9
68  netadm    7244K    4504K   sleep 59    0   0:00:00 0.000% ipmgmtd/7
Total: 74 processes, 785 lwps, load averages: 0.06, 0.09, 0.19

-c : Print new reports below previous reports instead of overprinting them. More on prstat command Man Page.

Example 10: How to report information about all processes and users using prstat command 

If you want to show information about all the processes and users then you need to use prstat -a command as shown below. This command will show memory and cpu utilization based on Process ID as well as for Users in a separate section.

root@localhost:~# prstat -a
PID  USERNAME   SIZE     RSS    STATE PRI NICE   TIME CPU PROCESS/NLWP
815    root    180408K 164716K  sleep 59   0   0:00:52 0.272% sstored/16
1192   root    5452K    3864K   cpu1  49   0   0:00:00 0.101% prstat/1
1155   root    16124K   8600K   sleep 59   0   0:00:00 0.024% sshd/1
956    root    28392K   13692K  sleep 59   0   0:00:01 0.021% sysstatd/14
5      root      0K      0K     sleep 99  -20  0:00:06 0.021% zpool-rpool/166
1159   root    5500K    3544K   sleep 49   0   0:00:00 0.012% bash/1
812   webservd 24008K   8812K   sleep 59   0   0:00:00 0.012% httpd/18
809    root    5868K    2964K   sleep 59   0   0:00:00 0.009% hald-addon-acpi/1
799    root    10656K   7524K   sleep 59   0   0:00:01 0.009% hald/4
804    root    14412K   4776K   sleep 59   0   0:00:00 0.009% httpd/1
873    root    15164K   7160K   sleep 59   0   0:00:00 0.003% inetd/4
323    root    15108K   8724K   sleep 59   0   0:00:00 0.003% devfsadm/5
614   netadm   13544K   5432K   sleep 59   0   0:00:00 0.003% dhcpagent/1
980    root    16648K   2540K   sleep 59   0   0:00:00 0.003% sendmail/1
853   daemon   6308K    4024K   sleep 59   0   0:00:00 0.000% rpcbind/1
215   daemon   3508K    1316K   sleep 59   0   0:00:00 0.000% utmpd/1
655    root    11948K   1372K   sleep 59   0   0:00:00 0.000% sshd/1
324    root    4608K    2076K   sleep 60 -20   0:00:00 0.000% zonestatd/5
603   netadm   18352K   10244K  sleep 59   0   0:00:00 0.000% nwamd/8
754    root     0K       0K     sleep 99 -20   0:00:00 0.000% zpool-tpool/166
256    root    11536K   4644K   sleep 59   0   0:00:00 0.000% syseventd/18
207    root    3744K    1620K   sleep 59   0   0:00:00 0.000% hotplugd/2
273    root    5484K    2512K   sleep 59   0   0:00:00 0.000% dbus-daemon/1
98     root    12940K   4636K   sleep 59   0   0:00:00 0.000% in.mpathd/1
109   daemon   11008K   1788K   sleep 60 -20   0:00:00 0.000% kcfd/3
742    root    10776K   1284K   sleep 59   0   0:00:00 0.000% iscsid/2
162    root    3888K    1756K   sleep 59   0   0:00:00 0.000% pfexecd/3
138    root    13540K   8460K   sleep 59   0   0:00:01 0.000% sysobjd/9
68    netadm   7244K    4504K   sleep 59   0   0:00:00 0.000% ipmgmtd/7
104    root    5432K    3028K   sleep 59   0   0:00:00 0.000% in.ndpd/1
NPROC USERNAME SWAP      RSS    MEMORY  TIME   CPU
60    root     441968K 389764K 15.01% 0:02:28 0.488%
4     webservd 20416K  31040K  1.195% 0:00:00 0.012%
4     netadm   9356K   20464K  0.788% 0:00:00 0.003%
2     noaccess 2164K   11540K  0.444% 0:00:00 0.000%
1     smmsp    3012K   9156K   0.353% 0:00:00 0.000%
3     daemon   3896K   12396K  0.477% 0:00:00 0.000%

Example 11: How to show information about home lgroup using prstat command in UNIX

If you want to show information about home lgroup then you need to use prstat -H command as shown below.

root@localhost:~# prstat -H
PID   USERNAME    SIZE      RSS    STATE PRI NICE TIME     CPU   LGRP PROCESS/NLWP
815    root       180408K  164716K sleep 59   0   0:00:53 0.153%  0    sstored/16
5      root       0K        0K     sleep 99  -20  0:00:06 0.110%  0    zpool-rpool/166
1201   root       5684K    4096K   cpu1  59   0   0:00:00 0.058%  0    prstat/1
1155   root       16124K   8600K   sleep 59   0   0:00:00 0.018%  0    sshd/1
809    root       5884K    2980K   sleep 59   0   0:00:00 0.012%  0    hald-addon-acpi/1
1159   root       5500K    3544K   sleep 59   0   0:00:00 0.009%  0    bash/1
799    root       10656K   7524K   sleep 59   0   0:00:01 0.009%  0    hald/4
956    root       28392K   13692K  sleep 59   0   0:00:01 0.009%  0    sysstatd/14
812   webservd    24008K   8812K   sleep 59   0   0:00:00 0.006%  0    httpd/18
804    root       14412K   4776K   sleep 59   0   0:00:00 0.003%  0    httpd/1
323    root       15108K   8724K   sleep 59   0   0:00:00 0.003%  0    devfsadm/5
779    root       11156K   4168K   sleep 59   0   0:00:00 0.000%  0    cron/1
288    root       7444K    3600K   sleep 59   0   0:00:00 0.000%  0    svc.periodicd/6
276    root       23152K   10508K  sleep 59   0   0:00:00 0.000%  0    rad/10
864    root       141776K  51576K  sleep 59   0   0:00:03 0.000%  0    fmd/45
614   netadm      13544K   5432K   sleep 59   0   0:00:00 0.000%  0    dhcpagent/1
235    root       5132K    2124K   sleep 59   0   0:00:00 0.000%  0    vbiosd/3
667    root       14348K   5040K   sleep 59   0   0:00:00 0.000%  0    smbclntd/2

-H : Report information about home lgroup. More on prstat command Man Page.

Example 12: How to Report microstate process accounting information using prstat command 

If you want to show microstate process accounting information then you need to use prstat -m command as shown below.

root@localhost:~# prstat -m
PID   USERNAME USR   SYS   TRP   TFL   DFL   LCK   SLP   LAT VCX ICX SCL   SIG PROCESS/NLWP
1212   root   21.59 77.54 0.029 0.000 0.000 0.000 0.000 0.742 0  293 27555  0   prstat/1
815    root   0.141 0.041 0.000 0.000 0.000 12.78 86.98 0.064 2   0   23    0   sstored/16
15     root   0.059 0.062 0.000 0.000 0.000 6.772 92.92 0.187 41  1   148   0   svc.configd/30
13     root   0.018 0.034 0.000 0.000 0.000 40.92 58.31 0.126 40  1   96    0   svc.startd/13
1155   root   0.011 0.024 0.000 0.000 0.000 0.000 99.96 0.008 2   0   35    0   sshd/1
809    root   0.010 0.022 0.000 0.000 0.000 0.000 99.95 0.014 3   0   16    0   hald-addon-acpi/1
804    root   0.007 0.021 0.000 0.000 0.000 0.000 99.91 0.066 5   0   10    0   httpd/1
989    root   0.004 0.015 0.000 0.000 0.000 0.000 99.94 0.045 0   0   15    0   login/1
799    root   0.007 0.009 0.000 0.000 0.000 25.00 74.98 0.006 0   0   18    0   hald/4
1159   root   0.004 0.009 0.000 0.000 0.000 0.000 99.98 0.003 0   0    7    0   bash/1
614   netadm  0.004 0.007 0.000 0.000 0.000 0.000 99.98 0.009 1   0    6    0   dhcpagent/1
98     root   0.002 0.010 0.000 0.000 0.000 0.000 99.99 0.001 0   0    8    0   in.mpathd/1
873    root   0.004 0.005 0.000 0.000 0.000 24.98 74.99 0.015 6   0    15   0   inetd/4
980    root   0.004 0.004 0.000 0.000 0.000 0.000 99.99 0.005 1   0    6    0   sendmail/1
138    root   0.003 0.004 0.000 0.000 0.000 33.33 66.66 0.004 1   0    11   0   sysobjd/9

-m : Report microstate process accounting information. More on prstat command Man Page.

Example 13: How to put prstat in the real time scheduling class using prstat command in UNIX

If you want to put prstat in the real time scheduling class then you need to use prstat -R command as shown below.

root@localhost:~# prstat -R
PID  USERNAME  SIZE     RSS    STATE PRI NICE   TIME    CPU   PROCESS/NLWP
815   root    180424K  164732K sleep 59   0    0:00:54 0.232% sstored/16
1221  root     5452K   3864K   cpu1 100   -    0:00:00 0.098% prstat/1
5     root      0K       0K    sleep 99  -20   0:00:07 0.095% zpool-rpool/166
1155  root    16124K    8600K  sleep 59    0   0:00:00 0.052% sshd/1
1159  root    5500K    3544K   sleep 49    0   0:00:00 0.043% bash/1
956   root    28392K   13692K  sleep 59    0   0:00:01 0.031% sysstatd/14
15    root    74776K   70744K  sleep 59    0   0:01:09 0.021% svc.configd/30
621   root    21900K   7812K   sleep 59    0   0:00:02 0.018% nscd/42
812  webservd 24008K   8812K   sleep 59    0   0:00:00 0.009% httpd/18
809   root    5900K    3004K   sleep 59    0   0:00:00 0.006% hald-addon-acpi/1

-R : Put prstat in the real time scheduling class. When this option is used, prstat is given priority over time-sharing and interactive processes. More on prstat command Man Page.

 

Popular Recommendations:-

Introduction to Openstack and Best Benefits of Its Components(v16.0)

Best Steps to Use Devstack for Openstack Installation on CentOS 7

How to Install gcloud SDK on CentOS 7 using best steps

How to Use gcloud for GCP Login in 2 Best Steps

Best Steps to create a Database in Oracle DB 12c

Easy Steps to Install Oracle Database 12c in Windows 10

How to Install Redis on Ubuntu 18.04

Useful C Program to List Network Interfaces Using Only 30 Lines of Code

UNIX prstat command examples (Solaris 10)

Advertisements

Leave a Reply