Unix command to find CPU Utilization

http://www.cyberciti.biz/faq/unix-command-to-find-cpu-utilization/spa

Task:Watching system activity evolve i.e. reports CPU Utilization

# sar -u 12 5unix

Where,code

  • -u 12 5: Comparison of CPU utilization; 12 seconds apart; 5 times.

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 10orm

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-fileci

UNIX mpstat example

Type the following command to display per-processor statistics; 12 seconds apart; 5 times
# mpstat 12 5it

You can also use traditional ps and top command:
# top
# ps -e -o pcpu -o pid -o user -o args
io

Read man pages of ps, top, mpstat and sar for more information.form

相關文章
相關標籤/搜索