Memory and CPU usage tools on Illumos

This is only a small overview of memory and CPU usage tools on Illumos. Mostly I forgot the commands so it's like a personal reference page :-)

Total physical memory

Show DIMM and hardware overview via prtdiag:

prtdiag -v

Show max physical memory via prtconf:

prtconf | grep Memory

Create an overview 10 times every 5 seconds:

vmstat 5 10

Memory usage by process

Show percentage of memory usage by process, you could use sort to sorting the output:

ps -A -o pmem -o pcpu -o args

Overall CPU usage

Two processor reports with five seconds interval:

mpstat 5 2

Important fields are:

  • usr: user time in percent
  • sys: system time in percent
  • idl: idle time in percent

CPU usage by process

Use prstat which is more or less similar to top on Linux. There are different sorting and command line options available.

Sort by cpu usage (default):

prstat 

Sort by memory usage:

prstat -s rss

Sort by virtual memory usage:

prstat -s size

Sort by process execution time:

prstat -s time

Find top five processes:

prstat -n 5

Also print process numbers for each user:

prstat -a

Follow a particular process id:

prstat -p <pid>

Follow threads of a particular process id:

prstat -L -p <pid>

Posted

March 03, 2016, 11:26 am

Tags

, , , , ,

More

Permalink

Comments

Send your comment by mail.