Patch for Circular Paths (new algo) 70s->0.007s :)

nap naparuba at gmail.com
Tue May 13 19:59:59 CEST 2008


Hi Ethan, Hi list,

I test the current cvs version and the circular host check is still slow:
current version:
CONFIG VERIFICATION TIMES          (* = Potential for speedup with -x option)
----------------------------------
Object Relationships: 0.582019 sec
Circular Paths:       9.895108 sec  *
Misc:                 0.003989 sec
                      ============
TOTAL:                10.481116 sec  * = 9.895108 sec (94.4%) estimated savings


I make the circular patch for the current version and I try it:
CONFIG VERIFICATION TIMES          (* = Potential for speedup with -x option)
----------------------------------
Object Relationships: 0.580119 sec
Circular Paths:       0.268966 sec  *
Misc:                 0.003847 sec
                      ============
TOTAL:                0.852932 sec  * = 0.268966 sec (31.5%) estimated savings

Can you have a look to it? I can give you my cfg file for the check.

Thanks,


Gabès Jean


On Sat, Feb 2, 2008 at 8:35 PM, nap <naparuba at gmail.com> wrote:
> Of course, I forgot the temp.cfg. sorry.
>
>
>  Jean
>
>
>
>  On Feb 2, 2008 7:32 PM, nap <naparuba at gmail.com> wrote:
>  > Hi list,
>  >
>  > I test a difficult sample (like your one Andreas). The test.cfg is the
>  > configuration file for nagios, and circular_check.png is a image of
>  > the configuration, and all the loops :)
>  > Red items are bad: the are in loops, green are OK. Red items need to
>  > be in error state, and just them. I realize my previous patch showed
>  > too much errors when a host was in 2 differents loops. Now It's OK.
>  >
>  > I change the output of my patch to fit exactly to the original output.
>  >
>  > You can use test.cfg and had some nasty parents relations, and see if
>  > the patch show all errors.
>  >
>  >
>  > Jean
>  >
>  >
>  >
>  > On Feb 1, 2008 11:44 AM, nap <naparuba at gmail.com> wrote:
>  > > Hi,
>  > >
>  > > Here is the patch without the space. I just test it and it apply to
>  > > the cvs version.
>  > >
>  > > I'll check for the object.cache and try to make mode funny samples
>  > > (I'll become a master of awk after that...). I think the exemple you
>  > > give will be ok with my algo (it's a standard algo for check graphs),
>  > > and we check a node one and only one time so no problem with
>  > > complexity I think. I'll post the sample, but if you already have some
>  > > special case, I take them :)
>  > > You can see the test.cfg. It's the sample with a loop. But it's a simple loop.
>  > >
>  > > I'm ok with your conclusion, if the algo if false, it's useless ;)
>  > >
>  > > I'll work for big complex sample this week-end, if you don't post the
>  > > results monday, it's that i'm dead while reading the man of awk.
>  > >
>  > > After that, I'll trace the services dependencies check.
>  > >
>  > >
>  > > Jean
>  > >
>  > >
>  > >
>  > > On Feb 1, 2008 11:26 AM, Andreas Ericsson <ae at op5.se> wrote:
>  > > > Andreas Ericsson wrote:
>  > > > > nap wrote:
>  > > > >> Hi list,
>  > > > >>
>  > > > >> I finish my patch for the host path part. I try to folow the
>  > > > >> indentation and the coding style of nagios.
>  > > > >
>  > > > > It looks a lot better now. For extra points, remove the hunks that
>  > > > > only insert whitespace changes.
>  > > > >
>  > > > >> you can find test files with a lot of parent/childs at
>  > > > >> http://zegabes.free.fr/nagios/ .
>  > > > >>
>  > > > >
>  > > > > What's lacking from that place is the objects.cache using the old
>  > > > > code and one generated using the new one, especially with multiple
>  > > > > parents, as well as a diff between them so one can see what, if any,
>  > > > > the differences are.
>  > > > >
>  > > >
>  > > > I take that back. What's lacking is a proper test-case. If the config
>  > > > you've been using to test is the one on that site, you haven't even
>  > > > scratched at the funnier configs one sometimes see.
>  > > >
>  > > > For now, you're doing a "parent -> 100 children" thing, which is
>  > > > obviously quite quick and very simple to get correct values for.
>  > > > Will your algorithm work for something like this?
>  > > >
>  > > >           parent2                                parent8 ----------
>  > > >        /          \                            /                   \
>  > > > parent0 - parent3 - parent5 - parent6 - parent7                     \
>  > > >        \          /                            \                     \
>  > > >           parent4                                parent9 - parent10 - endhost
>  > > >           /                                                          /
>  > > >          /                                                          /
>  > > >         /                                                          /
>  > > > parent11-----------------------------------------------------------
>  > > >
>  > > >
>  > > > Which is indeed a rather messy and complex scheme, but something that
>  > > > nagios should handle (it does today, so it has to do so tomorrow too).
>  > > >
>  > > > Optimizing for speed in the simple (and probably most common cases) is
>  > > > all fine and good, but if things suddenly break horribly for 15-20% of
>  > > > the user-base, it isn't worth a thing.
>  > > >
>  > > >
>  > > > --
>  > > > Andreas Ericsson                   andreas.ericsson at op5.se
>  > > > OP5 AB                             www.op5.se
>  > > > Tel: +46 8-230225                  Fax: +46 8-230231
>  > > >
>  > > > -------------------------------------------------------------------------
>  > > > This SF.net email is sponsored by: Microsoft
>  > > > Defy all challenges. Microsoft(R) Visual Studio 2008.
>  > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>  > > > _______________________________________________
>  > > > Nagios-devel mailing list
>  > > > Nagios-devel at lists.sourceforge.net
>  > > > https://lists.sourceforge.net/lists/listinfo/nagios-devel
>  > > >
>  > >
>  >
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: circular-parents3.patch
Type: text/x-diff
Size: 6277 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20080513/7134a289/attachment.patch>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list