[collectd] how to limit display to a particular range of values

Florian Forster octo at verplant.org
Sat Dec 20 11:03:39 CET 2008

Hi Florian,

On Tue, Dec 09, 2008 at 04:25:58PM +0100, florian iragne wrote:
> I've a VE which is the collectd Master, and all other are clients
> (about 15 VE). Everything is fine except the display of cpu usage.
> Indeed, i have values of several billions % for io-waits. I don't
> understand why since the VE are not under a heavy load.

that's weird. Do other tools, such as `top' and `mpstat', report correct
values for IO-wait?

> Hence, this very high iowait percentage is obfuscating the "real" cpu
> usage (user/system), so that i would like to limit displayed values to
> something like 120% at max.

We can't sanely limit the `cpu' ``type'' to a small maximum value,
because CPU time is not measured in percent but in jiffies, the unit
used by the scheduler. This is a common misconception, because under
many distributions the Linux kernel is configured to have
(approximately) 100 jiffies per second.

If you want to limit all CPU graphs from exceeding a certain value, for
example 120 jiffies per second, you need to overwrite the `cpu' type.
For that, create a second, custom `types.db' file (see types.db(5) for
details on the file format). For example:
  # cat /etc/collectd/types.db.custom
  cpu value:COUNTER:0:120

Then add a `TypesDB' entry to the config file. Be sure to un-comment the
commented-out line that specifies the default. If you don't *only* your
custom file will be loaded. Also, make sure your custom file is loaded
*after* the default file, because later files can and will overwrite
previous definitions. So your file will overwrite the `cpu' type
specifies by default, which holds the extremely large maximum value of

> I'm using collectd 3.10.4-1 from debian etch and display the values
> with collection.cgi

Sorry, I didn't see that comment in time: No, using 3.* there is no way
to specify that except compiling the daemon yourself and editing the
source code of the cpu plugin. The comment above only apply for 4.*.

Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
-------------- 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/20081220/4db966dd/attachment.pgp 

More information about the collectd mailing list