Pages

Wednesday, March 28, 2012

cat /proc/stat, cpu usage statistics

$ cat /proc/stat
cpu  24520180 352244 4425876 7951926999 3224192 100881 459528 0
cpu0 119971 3303 115696 498811501 11968 1 727 0
cpu1 156720 3887 74144 498757056 66536 2695 2103 0
cpu2 263824 60442 191283 498342148 157819 40037 7597 0
cpu3 220047 5331 54459 498698411 82321 1038 1524 0


 intr 1353911813 696186424 3 0 4 4 0 0 0 1 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ctxt 1255715782
btime 1327970777
processes 15808890
procs_running 2
procs_blocked 0

==>

first row columns values are sum of corresponding values in rest of the columns for all cpu cores.

in subsequent rows, first column has core id. rest columns hold,
  • 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

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


The "ctxt" line gives the total number of context switches across all CPUs.



The "btime" line gives the time at which the system booted, in seconds since
the Unix epoch.



The "processes" line gives 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.




The "procs_running" line gives the number of processes currently running on CPUs.



The "procs_blocked" line gives the number of processes currently blocked, waiting for I/O to complete.
copied from the kernel documentation of the /proc filesystem


Note:
The 8th column is called steal_time. It counts the ticks spent
executing other virtual hosts (in virtualised environments like Xen)
Note2:
With Linux 2.6.24 there is 9th column for (virtual) guest systems. See man 5 proc.


No comments:

Post a Comment