[collectd] swap plugin improvements

Aurélien Reynaud aurelien at wattapower.net
Fri Dec 17 22:59:54 CET 2010


Le lundi 06 décembre 2010 à 11:27 +0100, Florian Forster a écrit :
> I've just tinkered with the Swap plugin so swapctl(2) and kstat(3KSTAT)
> can both be used on Solaris. The result is a mess of preprocessor #if
> blocks and weird defaults, but I think all in all the default behavior
> is intuitive:
> 
>   * If swapctl(2) is available, it is the default facility. You can set
>     the "ReportPhysical" option to "separate" to get per-device
>     statistics.
>   * If kstat(3KSTAT) is available, too, you can set "ReportVirtual" to
>     "true" to enable virtual swap statistics. You can also set
>     "ReportPhysical" to "false" to disable physical swap information and
>     get the collectd 4 behavior.
>   * If kstat(3KSTAT) is available and swapctl(2) isn't, the plugin will
>     behave like it did under collectd 4.
> 
> > Sounds reasonable to be, as long as "combined" is the default. The
> > total values are what IT execs and developers are interested in. The
> > exact physical layout of swap is for admins fine-tuning their
> > systems...
> 
> I totally agree ;)
> 
> On Thu, Oct 07, 2010 at 11:24:24PM +0200, Aurélien Reynaud wrote:
> > In my original posting, I suggested moving the "-s" (virtual memory)
> > to the vmem plugin which is currently linux-only. Don't you think this
> > would make sense?
> 
> I guess it'd make sense. I don't have the experience with Solaris to
> implement useful vmem statistics, though.
> 
> It might make sense to remove the kstat code from the swap plugin
> altogether, even if this means that the functionality won't be available
> at first. It can then be added to the vmem plugin whenever someone with
> enough knowledge of Solaris virtual memory steps up and implements it.
> What do you think?

Hello Florian,

I think you're right. The basic (and arguably most important)
functionality is provided by swapctl() which has been available for a
while and will probably remain so for the foreseeable future. Backwards
compatibility is sacred on industrial products. So I vote for removing
the kstat() code from the swap plugin altogether.

It should indeed be moved to the vmem plugin. I could have provided a
patch for this but couldn't have by any means done better than you
would. I don't have enough expertise in Solaris to make sure the metrics
would be adequate for somenone needing something useful.

As you said, we maybe we should wait for someneone competent to step up.
Or maybe we could blindly port the code just to show it can be done, and
expect someone to get so scandalized that he starts throwing stones at
us before showing us how it should have been done...

But compatibility and consistency are important for collectd too, so the
first solution is probably the best.


Regards,
Aurélien Reynaud




More information about the collectd mailing list