Unix command to find CPU Utilization
Q. I am using Solaris UNIX. How do I find out CPU Utilization under Sun Solaris UNIX?
A. Under Sun Solaris UNIX (and other UNIX oses like HP-UX and *BSD oses) you can use following commands to gather CPU information:
=> sar : System activity reporter
=> mpstat : Report per-processor or per-processor-set statistics
=> ps / top commands
Note: Linux specific CPU utilization information is here. Following information applies to UNIX only.
UNIX sar command examples
General syntax is as follows:
sar t [n]
In the first instance, sar samples cumulative activity counters in the operating system at n intervals of t seconds, where t should be 5 or greater. If t is specified with more than one option, all headers are printed together and the output may be difficult to read.
Task: Display today's CPU activity, use
# sar
Task:Watching system activity evolve i.e. reports CPU Utilization
# sar -u 12 5
Where,
- -u 12 5: Comparison of CPU utilization; 12 seconds apart; 5 times.
Output includes:
- %usr: User time (% of CPU)
- %sys: System time (% of CPU)
- %wio: Percent of CPU running idle with a process waiting for block I/O
- %idle: Percent of CPU that is idle
Task: You can watch CPU activity evolve for 10 minutes and save data
# sar -o file-name 60 10
Task: You can just sar and logout and let the report store in files
# nohup sar -A -o output-file 60 10 1>/dev/null 2>&1 &
Note to display data stored in output-file pass -f option to sar command:
# sar -f output-file
UNIX mpstat example
Type the following command to display per-processor statistics; 12 seconds apart; 5 times
# mpstat 12 5
You can also use traditional ps and top command:
# top
# ps -e -o pcpu -o pid -o user -o args
Read man pages of ps, top, mpstat and sar for more information.
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- Linux performance tools to troubleshoot problem
- Linux Track NFS Directory / Disk I/O Stats
- Linux display each multiple SMP CPU processors utilization individually
- How do I find out Linux System Memory Utilization?
- Linux display CPU information - number of CPUs and their speed
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
~ Last updated on: January 13, 2007


September 20th, 2007 at 9:57 am
i want to learn linux this is very useful and powerful compare to Windows.
February 12th, 2008 at 10:15 am
How to install pine in Sun Solaris 10.5 under UNIX env?