Unix Cpu Utilization
Unix Cpu Utilization
use following commands to gather CPU information: => sar : System activity reporter => mpstat : Report per-processor or per-processor-set statistics => ps / top commands
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
# sar -u 12 5
Where,
Output includes: 1. %usr: User time (% of CPU) 2. %sys: System time (% of CPU) 3. %wio: Percent of CPU running idle with a process waiting for block I/O 4. %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
time data, unlike SAR and MPStat. To use it, simply type "top" into your terminal. You can also type "top -o cpu" to tell Top to sort its results in order of processes that are using the most CPU time. You can exit Top by hitting "q" at any time. Top is a good choice for users who want a fast, one-time idea of what CPU utilization is at that moment in order to diagnose sluggish performance.
@Read man pages of ps, top, mpstat and sar for more information.