[ale] jiffies & cat /proc & mysql - oh, my!

Chris Kleeschulte chris.kleeschulte at it.libertydistribution.com
Fri Jan 30 14:39:10 EST 2009


I studied the Linux kernel pretty heavily in college, but I am no  
means an expert. I can say that I would never use jiffies for  
benchmarking anything. The code comments surrounding the code in the  
kernel illustrates this. That does not really help you though, sorry,  
but I would find another method for monitoring cpu utilization. I can  
explain why using jiffies is bad, but that may be overkill.



Chris

On Jan 30, 2009, at 2:05 PM, Sid Lane wrote:

> all,
>
> I'm playing w/a script that monitors cpu utilization (mysqld in my  
> case) by taking the delta of user & system jiffies in /proc/$PID  
> between loops at regular intervals.  since individual jiffy mileage  
> may vary I did a calibration test by watching a gzip -c  
> bigarsefile.gz > /dev/null.  100% of the time the delta between  
> loops is 100 jiffies/sec while top reports that PID @ 100% cpu  
> utilization (i.e. saturating one core - the goal for the  
> benchmark).  this leads me to conclude that a jiffy on my box (dual  
> quad-core Dell 2950 running openSuSE 11 FWIW) is .01 CPU*s so I  
> should have a theoretical 800 jiffies/sec on this box (8 cores).   
> the problem (or ? I can't explain) is that I have a data point for  
> my mysqld PID where the 10 second delta is 9,402 (7,586 user/1,834  
> sys) which is almost 20% above what should be possible.  it would  
> make sense if a jiffy were 1/120th of a second (=> 9,600 would be  
> available in 10 sec) but (again) my gzip test consistently produces  
> 500 per 5 seconds (=> 100/s) so I don't know what to make of this  
> data point.  I though about lack of time precision in my  
> measurements but 18%?  for a 30 second sample?  when the lowest 5  
> second value for the gzip test was 498/highest 502?
>
> any idea what to make of this?  I need to have confidence in this  
> data for scaling testing/planning I'm doing...
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale



More information about the Ale mailing list