[Nagios-devel] Patchs proposal

nap naparuba at gmail.com
Sun May 17 15:32:30 UTC 2009


On Sun, May 17, 2009 at 3:20 PM, Andreas Ericsson <ae at op5.se> wrote:
> nap wrote:
>> On Sat, May 16, 2009 at 11:50 AM, Andreas Ericsson <ae at op5.se> wrote:
>>> nap wrote:
>>>> This is for the circular host check. I use bit 1->5 of
>>>> host->is_being_freshened. I'm doing now the hostgroup's service patch.
>>>>
>>> Thanks a lot! I've mangled the implementation a bit, using macros for
>>> the most part and accessing host->circular_path_checked instead of
>>> the higher order bits of is_being_freshened. Since it's now using
>>> macros, we could re-use this for host- and service dependencies too,
>>> as those also have the circular_path_checked variable.
>> Yes, the same algorithm can be use. :)
>>
>>> Timing values from a config with 151109 hosts:
>>> Patched
>>> 6.28user 0.19system 0:06.58elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k
>>> 0inputs+0outputs (0major+65723minor)pagefaults 0swaps
>>>
>>> Unpatched
>>> Ctrl-C before it was finished, providing these numbers:
>>> 3221.77user 0.31system 53:56.51elapsed 99%CPU (0text+0data 0max)k
>>> 0inputs+0outputs (0major+67480minor)pagefaults 0swaps
>>>
>>> So far, your patch provides a speedup of *at least* 51302%. Very nice
>>> indeed.
>> Thanks,
>>
>>> With a more modest configuration (15000 hosts), Nagios patched with your
>>> DFS code completes in 0.72 seconds, while vanilla Nagios needs 3m 33s to
>>> verify it. In short; Your patch cuts configuration verification down to
>>> 0.3% of what it originally required. I suspect we can get rid of the
>>> pre-cache thing entirely now. The speedups it provides are really no
>>> longer enough to warrant the complexities it entails.
>>>
>>> I've also verified with some very strange configurations that it doesn't
>>> ever miss a circular path chain, and it also prints all elements of a
>>> circular path even if that chain in itself contains a circular chain.
>>>
>>> Consider this:
>>> host1 parents: host2
>>> host2 parents: host1,host3
>>> host3 parents: host1
>>>
>>> With your patch, all three hosts are printed (as they should). With
>>> vanilla Nagios, only host1 and host2 are printed. I simplified this
>>> example a bit, since I just added random circular paths to a customer's
>>> config when I was testing it out, but it seems your patch is more
>>> correct while at the same time scaling linearly with the number of
>>> hosts. Thanks indeed.
>>>
>> Maybe we can take part of my very first email for this patch for the
>> documentation. I wrote how the patch is working (with the differents
>> state, etc).
>>
>
> There's no need to document this patch really, apart from its effects
> which will have to go in a release-note.
>
>> Is the patch ok for the next Nagios version?
>>
>
> Both yes and no. I modified it quite extensively, but I've committed
> it to Nagios CVS. The effects of it will be in the next nagios release,
> but the exact code you wrote is not there. Check out latest CVS and
> have a look in base/config.c and you'll see how it turned out.
I'll have a look at it. The more important is the fast load of Nagios
and that I will not have to patch my production Nagios anymore :)


Jean

>
> --
> Andreas Ericsson                   andreas.ericsson at op5.se
> OP5 AB                             www.op5.se
> Tel: +46 8-230225                  Fax: +46 8-230231
>
> Register now for Nordic Meet on Nagios, June 3-4 in Stockholm
>  http://nordicmeetonnagios.op5.org/
>
> Considering the successes of the wars on alcohol, poverty, drugs and
> terror, I think we should give some serious thought to declaring war
> on peace.
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables
> unlimited royalty-free distribution of the report engine
> for externally facing server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Nagios-devel mailing list
> Nagios-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-devel
>




More information about the Nagios-devel mailing list