[collectd] cpu module and saving jiffies / OpenBSD

Florian Forster octo at verplant.org
Mon Aug 11 16:44:56 CEST 2008


Hi again,

On Mon, Aug 04, 2008 at 05:22:50PM +0200, Sebastian Harl wrote:
> On Linux, the default is usually to have 100 jiffies per second. So,
> in that case, you automagically get a percentage value.

in theory, that is. The problem is that with timing and interrupts and
stuff this may be off. This graph
<http://verplant.org/temp/cpu-jiffies.png>
shows the CPU usilisation of a machine that does heavy IO (it's the
machine collectd runs on and writes RRD files for quite some hosts). If
you look closely, you can see the idle area as a faint gray area.
Obviously those values don't add up to 100 nicely :/ The machine has
four Xeon CPUs with 3.06 GHz each (I think it's actually two CPUs with
hyperthreading, but I'm not at all sure about that).

Another machine, a Core2 Quad, does nearly no IO and shows the same
issue, though with far less pronounced. While backup is running, CPU 0
is busy with IO and all adds up nicely. CPU 1 and CPU 3 show a little
variance and CPU 2 shows significantly more than all the others. After
backup is finished CPU 2 ``calms down'' and CPU 3 begins flickering.

A third machine, a Pentium D with two CPUs, hardly shows any of this at
all. 

So this ``problem'' seems to depend on many factors: Number and type of
processors, CPU and IO usage all seem to play into it. And I bet the
kernel version has to do with it, too.

> > Now the values are accurate. I wonder why this is not by default a
> > GAUGE? Are there any reasons or should we change it?

The reason is simply that all operating systems I know of report this
information in the form of a counter.

I may change the collection3 CGI script in contrib/ to calculate
percentages instead of simply displaying the values as they are. No ETA
on that, though.

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080811/3ed3ce70/attachment.pgp 


More information about the collectd mailing list