JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 1M: System Administration Commands     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

Introduction

System Administration Commands - Part 1

System Administration Commands - Part 2

luxadm(1M)

mail.local(1M)

makedbm(1M)

makemap(1M)

masfcnv(1M)

mdlogd(1M)

mdmonitord(1M)

mdnsd(1M)

medstat(1M)

metaclear(1M)

metadb(1M)

metadetach(1M)

metadevadm(1M)

metahs(1M)

metaimport(1M)

metainit(1M)

metaoffline(1M)

metaonline(1M)

metaparam(1M)

metarecover(1M)

metarename(1M)

metareplace(1M)

metaset(1M)

metassist(1M)

metastat(1M)

metasync(1M)

metattach(1M)

mib2mof(1M)

mibiisa(1M)

mkbootmedia(1M)

mkdevalloc(1M)

mkdevmaps(1M)

mkfifo(1M)

mkfile(1M)

mkfs(1M)

mkfs_pcfs(1M)

mkfs_udfs(1M)

mkfs_ufs(1M)

mknod(1M)

mkntfs(1M)

mkpwdict(1M)

modinfo(1M)

modload(1M)

modunload(1M)

mofcomp(1M)

mofreg(1M)

monacct(1M)

monitor(1M)

mount(1M)

mountall(1M)

mountd(1M)

mount_hsfs(1M)

mount_nfs(1M)

mount_pcfs(1M)

mount_smbfs(1M)

mount_tmpfs(1M)

mount_udfs(1M)

mount_ufs(1M)

mpathadm(1M)

mpstat(1M)

msgid(1M)

mvdir(1M)

named(1M)

named-checkconf(1M)

named-checkzone(1M)

named-compilezone(1M)

ncaconfd(1M)

ncheck(1M)

ncheck_ufs(1M)

ndd(1M)

ndmpadm(1M)

ndmpd(1M)

ndmpstat(1M)

netadm(1M)

netcfg(1M)

netcfgd(1M)

netservices(1M)

netstat(1M)

netstrategy(1M)

newaliases(1M)

newfs(1M)

newkey(1M)

nfs4cbd(1M)

nfsd(1M)

nfslogd(1M)

nfsmapid(1M)

nfsref(1M)

nfsstat(1M)

nscadm(1M)

nscd(1M)

nscfg(1M)

nsdb-list(1M)

nsdb-nces(1M)

nsdbparams(1M)

nsdb-resolve-fsn(1M)

nsdb-update-nci(1M)

nslookup(1M)

nsupdate(1M)

ntfscat(1M)

ntfsclone(1M)

ntfscluster(1M)

ntfscmp(1M)

ntfscp(1M)

ntfsfix(1M)

ntfsinfo(1M)

ntfslabel(1M)

ntfsls(1M)

ntfsprogs(1M)

ntfsresize(1M)

ntfsundelete(1M)

nulladm(1M)

nwamd(1M)

obpsym(1M)

oplhpd(1M)

pageout(1M)

parted(1M)

pbind(1M)

pcitool(1M)

pfedit(1M)

pginfo(1M)

pgstat(1M)

picld(1M)

ping(1M)

pkg2du(1M)

pkgadd(1M)

pkgadm(1M)

pkgask(1M)

pkgchk(1M)

pkgcond(1M)

pkg.depotd(1M)

pkgrm(1M)

pkg.sysrepo(1M)

plockstat(1M)

pntadm(1M)

polkit-is-privileged(1M)

pooladm(1M)

poolbind(1M)

poolcfg(1M)

poold(1M)

poolstat(1M)

ports(1M)

poweradm(1M)

poweroff(1M)

powertop(1M)

pppd(1M)

pppoec(1M)

pppoed(1M)

pppstats(1M)

praudit(1M)

prctmp(1M)

prdaily(1M)

projadd(1M)

projdel(1M)

projmod(1M)

prstat(1M)

prtacct(1M)

prtconf(1M)

prtdiag(1M)

prtdscp(1M)

prtfru(1M)

prtpicl(1M)

prtvtoc(1M)

psradm(1M)

psrinfo(1M)

psrset(1M)

pwck(1M)

pwconv(1M)

quot(1M)

quota(1M)

quotacheck(1M)

quotaoff(1M)

quotaon(1M)

rad(1M)

raidctl(1M)

ramdiskadm(1M)

rarpd(1M)

rcapadm(1M)

rcapd(1M)

rctladm(1M)

rdate(1M)

rdisc(1M)

reboot(1M)

rem_drv(1M)

remove_allocatable(1M)

removef(1M)

reparsed(1M)

repquota(1M)

restricted_shell(1M)

rexd(1M)

rexecd(1M)

rlogind(1M)

rmmount(1M)

rmt(1M)

rmvolmgr(1M)

rndc(1M)

rndc-confgen(1M)

roleadd(1M)

roledel(1M)

rolemod(1M)

root_archive(1M)

route(1M)

routeadm(1M)

routed(1M)

rpcbind(1M)

rpc.bootparamd(1M)

rpcinfo(1M)

rpc.mdcommd(1M)

rpc.metad(1M)

rpc.metamedd(1M)

rpc.metamhd(1M)

rpc.rexd(1M)

rpc.rstatd(1M)

rpc.rusersd(1M)

rpc.rwalld(1M)

rpc.smserverd(1M)

rpc.sprayd(1M)

rpc.yppasswdd(1M)

rpc.ypupdated(1M)

rquotad(1M)

rsh(1M)

rshd(1M)

rstatd(1M)

rtc(1M)

rtquery(1M)

runacct(1M)

rusersd(1M)

rwall(1M)

rwalld(1M)

rwhod(1M)

sa1(1M)

sa2(1M)

sadc(1M)

sar(1M)

sasinfo(1M)

savecore(1M)

sbdadm(1M)

sched(1M)

sckmd(1M)

scmadm(1M)

sconadm(1M)

sendmail(1M)

sftp-server(1M)

shadowd(1M)

shadowstat(1M)

share(1M)

shareall(1M)

sharectl(1M)

share_nfs(1M)

share_smb(1M)

showmount(1M)

shutacct(1M)

shutdown(1M)

slpd(1M)

smattrpop(1M)

smbadm(1M)

smbd(1M)

smbiod(1M)

smbiod-svc(1M)

smbios(1M)

smbstat(1M)

smrsh(1M)

smtp-notify(1M)

sndradm(1M)

sndrd(1M)

sndrsyncd(1M)

snmpdx(1M)

snmp-notify(1M)

snmpXwbemd(1M)

snoop(1M)

soconfig(1M)

soladdapp(1M)

soldelapp(1M)

solstice(1M)

sppptun(1M)

spray(1M)

sprayd(1M)

srptadm(1M)

sshd(1M)

ssh-keysign(1M)

startup(1M)

statd(1M)

stclient(1M)

stmfadm(1M)

stmsboot(1M)

strace(1M)

strclean(1M)

strerr(1M)

sttydefs(1M)

su(1M)

sulogin(1M)

suriadm(1M)

svadm(1M)

svcadm(1M)

svcbundle(1M)

svccfg(1M)

svc.configd(1M)

svc.ipfd(1M)

svc.startd(1M)

swap(1M)

sxadm(1M)

sync(1M)

syncinit(1M)

syncloop(1M)

syncstat(1M)

sysconfig(1M)

sysdef(1M)

syseventadm(1M)

syseventconfd(1M)

syseventd(1M)

syslogd(1M)

talkd(1M)

tapes(1M)

telnetd(1M)

tftpd(1M)

th_define(1M)

th_manage(1M)

tic(1M)

tncfg(1M)

tnchkdb(1M)

tnctl(1M)

tnd(1M)

tninfo(1M)

tpmadm(1M)

traceroute(1M)

trapstat(1M)

ttymon(1M)

tunefs(1M)

turnacct(1M)

txzonemgr(1M)

tzreload(1M)

tzselect(1M)

uadmin(1M)

ucodeadm(1M)

ufsdump(1M)

ufsrestore(1M)

umount(1M)

umountall(1M)

System Administration Commands - Part 3

prstat

- report active process statistics

Synopsis

prstat [-acHJLmRrtTv] [-d u | d] [-C psrsetlist] [-h lgrplist] 
     [-j projlist] [-k tasklist] [-n ntop[,nbottom]] 
     [-p pidlist] [-P cpulist] [-s key | -S key ] 
     [-u euidlist] [-U uidlist] [-z zoneidlist] [-Z] 
     [interval [count]]

Description

The prstat utility iteratively examines all active processes on the system and reports statistics based on the selected output mode and sort order. prstat provides options to examine only processes matching specified PIDs, UIDs, zone IDs, CPU IDs, and processor set IDs.

The -j, -k, -C, -p, -P, -u, -U, and -z options accept lists as arguments. Items in a list can be either separated by commas or enclosed in quotes and separated by commas or spaces.

If you do not specify an option, prstat examines all processes and reports statistics sorted by CPU usage.

Options

The following options are supported:

-a

Report information about processes and users. In this mode prstat displays separate reports about processes and users at the same time.

-c

Print new reports below previous reports instead of overprinting them.

-C psrsetlist

Report only processes or lwps that are bound to processor sets in the given list. Each processor set is identified by an integer as reported by psrset(1M). The load averages displayed are the sum of the load averages of the specified processor sets (see pset_getloadavg(3C)). Processes with one or more LWPs bound to processor sets in the given list are reported even when the -L option is not used.

-d u | d

Specify u for a printed representation of the internal representation of time. See time(2). Specify d for standard date format. See date(1).

-h lgrplist

Report only processes or lwps whose home lgroup is in the given list of lgroups. No processes or lwps will be listed for invalid lgroups.

-H

Report information about home lgroup. In this mode, prstat adds an extra column showing process or lwps home lgroup with the header LGRP.

-j projlist

Report only processes or lwps whose project ID is in the given list. Each project ID can be specified as either a project name or a numerical project ID. See project(4).

-J

Report information about processes and projects. In this mode prstat displays separate reports about processes and projects at the same time.

-k tasklist

Report only processes or lwps whose task ID is in tasklist.

-L

Report statistics for each light-weight process (LWP). By default, prstat reports only the number of LWPs for each process.

-m

Report microstate process accounting information. In addition to all fields listed in -v mode, this mode also includes the percentage of time the process has spent processing system traps, text page faults, data page faults, waiting for user locks and waiting for CPU (latency time).

-n ntop[,nbottom]

Restrict number of output lines. The ntop argument determines how many lines of process or lwp statistics are reported, and the nbottom argument determines how many lines of user, task, or projects statistics are reported if the -a, -t, -T, -J or -Z options are specified. By default, prstat displays as many lines of output that fit in a window or terminal. When you specify the -c option or direct the output to a file, the default values for ntop and nbottom are 15 and 5.

-p pidlist

Report only processes whose process ID is in the given list.

-P cpulist

Report only processes or lwps which have most recently executed on a CPU in the given list. Each CPU is identified by an integer as reported by psrinfo(1M).

-R

Put prstat in the real time scheduling class. When this option is used, prstat is given priority over time-sharing and interactive processes. This option is available only for superuser.

-r

Disable lookups for user names and project names. (Note that this does not apply to lookups for the -j, -u, or -U options.)

-s key

Sort output lines (that is, processes, lwps, or users) by key in descending order. Only one key can be used as an argument.

There are five possible key values:

cpu

Sort by process CPU usage. This is the default.

pri

Sort by process priority.

rss

Sort by resident set size.

size

Sort by size of process image.

time

Sort by process execution time.

-S key

Sort output lines by key in ascending order. Possible key values are the same as for the -s option. See -s.

-t

Report total usage summary for each user. The summary includes the total number of processes or LWPs owned by the user, total size of process images, total resident set size, total cpu time, and percentages of recent cpu time and system memory.

-T

Report information about processes and tasks. In this mode prstat displays separate reports about processes and tasks at the same time.

-u euidlist

Report only processes whose effective user ID is in the given list. Each user ID may be specified as either a login name or a numerical user ID.

-U uidlist

Report only processes whose real user ID is in the given list. Each user ID may be specified as either a login name or a numerical user ID.

-v

Report verbose process usage. This output format includes the percentage of time the process has spent in user mode, in system mode, and sleeping. It also includes the number of voluntary and involuntary context switches, system calls and the number of signals received. Statistics that are not reported are marked with the - sign.

-z zoneidlist

Report only processes or LWPs whose zone ID is in the given list. Each zone ID can be specified as either a zone name or a numerical zone ID. See zones(5).

-Z

Report information about processes and zones. In this mode, prstat displays separate reports about processes and zones at the same time.

OUTPUT

The following list defines the column headings and the meanings of a prstat report:

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. This counts shared memory only once for each user, project, task, or zone. Swap is reserved when anonymous memory is allocated or files are mapped private. The value of swap is expressed in kilobytes (K), megabytes (M), or gigabytes (G).

RSS

The resident set size of the process (RSS), in kilobytes (K), megabytes (M), or gigabytes (G). The RSS value is an estimate provided by proc(4) that might underestimate the actual resident set size. Users who want to get more accurate usage information for capacity planning should use the -x option to pmap(1) instead.

STATE

The state of the process:

cpuN

Process is running on CPU N.

sleep

Sleeping: process is waiting for an event to complete.

wait

Waiting: process is waiting for CPU usage to drop to the CPU-caps enforced limits. See the description of CPU-caps in resource_controls(5).

run

Runnable: process in on run queue.

zombie

Zombie state: process terminated and parent not waiting.

stop

Process is stopped.

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. If executing in a non-global zone and the pools facility is active, the percentage will be that of the processors in the processor set in use by the pool to which the zone is bound.

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.

With the some options, in addition to a number of the column headings shown above, there are:

NPROC

Number of processes in a specified collection.

MEMORY

Percentage of memory used by a specified collection of processes.

The following columns are displayed when the -v or -m option is specified

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.

Under the -L option, one line is printed for each lwp in the process and some reporting fields show the values for the lwp, not the process.

The following column is displayed when the -H option is specified:

LGRP

The home lgroup of the process or lwp.

Operands

The following operands are supported:

count

Specifies the number of times that the statistics are repeated. By default, prstat reports statistics until a termination signal is received.

interval

Specifies the sampling interval in seconds; the default interval is 5 seconds.

Examples

Example 1 Reporting the Five Most Active Super-User Processes

The following command reports the five most active super-user processes running on CPU1 and CPU2:

example% prstat -u root -n 5 -P 1,2 1 1

PID   USERNAME  SWAP   RSS STATE  PRI  NICE      TIME  CPU PROCESS/LWP
 306   root     3024K 1448K sleep   58    0   0:00.00 0.3% sendmail/1
 102   root     1600K  592K sleep   59    0   0:00.00 0.1% in.rdisc/1
 250   root     1000K  552K sleep   58    0   0:00.00 0.0% utmpd/1
 288   root     1720K 1032K sleep   58    0   0:00.00 0.0% sac/1
   1   root      744K  168K sleep   58    0   0:00.00 0.0% init/1
TOTAL:       25, load averages:  0.05, 0.08, 0.12

Example 2 Displaying Verbose Process Usage Information

The following command displays verbose process usage information about processes with lowest resident set sizes owned by users root and john.

example% prstat -S rss -n 5 -vc -u root,john

 PID USERNAME USR SYS TRP TFL DFL LCK SLP LAT VCX ICX SCL SIG PROCESS/LWP
   1 root     0.0 0.0  -   -   -   -  100  -    0   0   0   0 init/1
 102 root     0.0 0.0  -   -   -   -  100  -    0   0   3   0 in.rdisc/1
 250 root     0.0 0.0  -   -   -   -  100  -    0   0   0   0 utmpd/1
1185 john    0.0 0.0  -   -   -   -  100  -    0   0   0   0 csh/1
 240 root     0.0 0.0  -   -   -   -  100  -    0   0   0   0 switchd/4
 TOTAL:       71, load averages:  0.02, 0.04, 0.08
 

Exit Status

The following exit values are returned:

0

Successful completion.

1

An error occurred.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os

See Also

date(1), lgrpinfo(1), plgrp(1), proc(1), ps(1), time(2), psrinfo(1M), psrset(1M), sar(1M), pset_getloadavg(3C), proc(4), project(4), attributes(5), resource_controls(5), zones(5)

Notes

The snapshot of system usage displayed by prstat is true only for a split-second, and it may not be accurate by the time it is displayed. When the -m option is specified, prstat tries to turn on microstate accounting for each process; the original state is restored when prstat exits. See proc(4) for additional information about the microstate accounting facility.

The total memory size reported in the SWAP and RSS columns for groups of processes can sometimes overestimate the actual amount of memory used by processes with shared memory segments.