Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/proc/stat interpretation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
tnt
Veteran
Veteran


Joined: 27 Feb 2004
Posts: 1227

PostPosted: Sun Oct 24, 2010 4:13 pm    Post subject: /proc/stat interpretation Reply with quote

I use /proc/stat to monitor CPU activity.
I read 'user', 'nice', 'system', 'iowait', 'irq' and 'softirq' per CPU. I omit 'idle'.

sometimes, I get sum of 'user', 'nice', 'system', 'iowait', 'irq' and 'softirq' bigger then 100% CPU time.

should this be considered as measuring error or CPU can be in more then one 'state' at the same time (for example, both in 'system' and 'iowait') ?
_________________
gentoo user
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Mon Oct 25, 2010 5:13 am    Post subject: Reply with quote

My first question would be, "where are you obtaining your number for what you referred to as '100% CPU time'?"

I'm not absolutely certain on this, but I believe the CPU states are mutually exclusive and collectively exhaustive. There is documentation of the meaning of these columns in /usr/src/linux/Documentation/filesystems/proc.txt (section 1.8), and in man page PROC(5). These are the column definitions from the kernel documentation (the tenth column is undocumented in the man page):

Quote:
- 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
- steal: involuntary wait
- guest: running a normal guest
- guest_nice: running a niced guest


I may be wrong that they are mutually exclusive and collectively exhaustive; I have noticed before that the utilization state percentages shown by the 'top' command generally add up to 100%, but sometimes exceed it (e.g. 100.1%). I have always just attributed that to rounding error:
Code:
Cpu(s):  4.3%us,  2.0%sy,  0.0%ni, 93.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st

_________________
patrix_neo wrote:
The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.
Back to top
View user's profile Send private message
tnt
Veteran
Veteran


Joined: 27 Feb 2004
Posts: 1227

PostPosted: Wed Oct 27, 2010 7:53 pm    Post subject: Reply with quote

I use classic rrdtool with cacti "frontend".
_________________
gentoo user
Back to top
View user's profile Send private message
Bones McCracker
Veteran
Veteran


Joined: 14 Mar 2006
Posts: 1611
Location: U.S.A.

PostPosted: Fri Oct 29, 2010 2:54 am    Post subject: Reply with quote

tnt wrote:
I use classic rrdtool with cacti "frontend".


Well, if you're not simply adding up the numbers from the very same read of /proc/stat, the discrepancy might simply be time.
_________________
patrix_neo wrote:
The human thought: I cannot win.
The ratbrain in me : I can only go forward and that's it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum