[ale] jiffies & cat /proc & mysql - oh, my!
Chris Kleeschulte
chris.kleeschulte at it.libertydistribution.com
Fri Jan 30 16:35:24 EST 2009
It is a definite quandary since most of the tools we rely on (top,
iostat, mpstat, sar, ps commands) rely on the software clock which
derives from jiffies. But, I would take a gander at this page:
http://www.makelinux.net/ldd3/chp-7-sect-1.shtml
There be a higher resolution ticker in the cpu itself that you can
leverage. Let us know what you find, I have never been down this
particular road before. Sort of interesting.
Chris
On Jan 30, 2009, at 4:02 PM, Sid Lane wrote:
> I am by no means attached to jiffies - just seemed like an easy way
> to get what I wanted.
>
> what is the most precise and/or accurate (preferrable inexpensive)
> way to track CPU utilization of a given PID? again, precision &
> accuracy are important for what I'm trying to prove...
>
> On Fri, Jan 30, 2009 at 2:39 PM, Chris Kleeschulte <chris.kleeschulte at it.libertydistribution.com
> > wrote:
> 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
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20090130/b7ef6e2b/attachment-0001.html
More information about the Ale
mailing list