사용자 도구

사이트 도구


os:system:usage:cpu:proc_stat

문서의 이전 판입니다!


/proc/stat 정보

개념

  1. Linux 상에서 CPU 사용률을 확인하려면 /proc/stat 정보를 확인해야 한다.
  2. 쓰여진 글은 kernel 2.6.x 기준으로 작성하였다.

계산공식

  1. CPU 사용률은 부팅후 지금까지 소모된 jiffies 의 크기를 나타낸다.
  2. /proc 정보를 확인해보자

cpu

CPU user nice system idle iowait irq softirq
cpu 7357238 7556 1623734 7430643990 26226529 125483 1240241
cpu0 2885881 1844 799830 1856977874 4873103 125483 1142224
cpu1 2165476 1864 356690 1854581772 9656034 0 44293
cpu2 1289125 1838 216393 1859517837 5753554 0 27451
cpu3 1016754 2010 250820 1859566506 5943836 0 26272
cpu cpu number, 맨처음의 cpu는 모든 CPU 정보를 나타낸것이다
user normal processes executing in user mode
nice niced processes executing in user mode
system processes executing in kernel mode
idle twiddling thumbs
iowait waiting for I/O to complete
irq servicing interrupts
softirq servicing softirqs

intr

  1. counts of interrupts serviced since boot time, for each of the possible system interrupts.
  2. The first column is the total of all interrupts serviced;
    each subsequent column is the total for that particular interrupt.

ctxt

  1. the total number of context switches across all CPUs.

btime

  1. the time at which the system booted, in seconds since the Unix epoch.

processes

  1. the number of processes and threads created, which includes (but is not limited to) those created by calls to the fork() and clone() system calls.

proces_running

  1. the number of processes currently running on CPUs.

process_blocked

  1. number of processes currently blocked, waiting for I/O to complete.
os/system/usage/cpu/proc_stat.1234626953.txt.gz · 마지막으로 수정됨: 2009/02/15 00:55 저자 starlits